int main(){int i;if(scanf("%d",&i))printf("Mahadev");elseprintf("krishna");return 0;}
int main(){while(printf("%d",2)2)printf("CProgramming\n");return 0;}
#include stdio.hWhat is the output of the following programint main() {int a1 = 3;int d = 4;int n = 1;int an = a1 + (n-1) * d;printf("The first term of the arithmetic progression is %d\n", a1);printf("The common difference is %d\n", d);printf("The number of terms is %d\n", n);printf("The nth term of the arithmetic progression is %d\n", an);return 0;}
#include stdio.hint x = 0;int f(){if (x == 0)return x + 1;elsereturn x - 1;}int g(){return x++;}int main(){int i = (f() + g()) | g(); //bitwise orint j = g() | (f() + g()); //bitwise or}
class output{public static void main(String args[]){double a, b,c;a = 3.0/0;b = 0/4.0;c=0/0.0;System.out.println(a);System.out.println(b);System.out.println(c);}}
public class CaesarCipher {If Input Text is " Sookshmas" what is its cipher text?public static String encrypt(String plaintext, int shift) {StringBuilder ciphertext = new StringBuilder();for (int i = 0; i plaintext.length(); i++) {char c = plaintext.charAt(i);if (Character.isLetter(c)) {c = (char) (((c - 'a' + shift) % 26) + 'a');}ciphertext.append(c);}return ciphertext.toString();}public static String decrypt(String ciphertext, int shift) {StringBuilder plaintext = new StringBuilder();for (int i = 0; i ciphertext.length(); i++) {char c = ciphertext.charAt(i);if (Character.isLetter(c)) {c = (char) (((c - 'a' - shift + 26) % 26) + 'a');}plaintext.append(c);}return plaintext.toString();}public static void main(String[] args) {String plaintext = "hello world";int shift = 3;String ciphertext = encrypt(plaintext, shift);System.out.println("Ciphertext: " + ciphertext);String decryptedText = decrypt(ciphertext, shift);System.out.println("Decrypted text: " + decryptedText);}}
a1 = 3What is the output of the following python programd = 3n = 3Sn = (n/2) * (2*a1 + (n-1)*d)print("The sum of the first", n, "terms of the arithmetic sequence with a1 =", a1, "and d =", d, "is:", Sn)