1.

What is the output of the following program ? Justify your answer. class Check {public static void chg (String (nm)){nm = "Aamna" ; // copy "Aamna" to nm}public void test() {String name = "Julius" ;System.out.println (name);chg(name);System.out.println(name);}}​

Answer»

Output of C programs | Set 32Predict the output of the following C programs.1. What will be the output of following program? Input: 1 3#includeint main(){ int a, B; if(scanf("%d%d", &a, &b)==2) printf("true"); ELSE printf("false"); RETURN 0;}Output: TrueExplanation: Scanf function returns integer value as its return type is integer. In the above question, if you will enter two integer values, then it will return 2. It means “if condition” BECOMES true, OTHERWISE “if condition” becomes false.2. What will be the output of following program?: #includeint main(){ int a=0; a=a++ + a++ - a++ + ++a; printf("%d\n", a); return 0;}



Discussion

No Comment Found