C Programming
Q81.
Consider the following code segment: for (int k=0; k<20; k=k+2) { if (k % 3 == 1) system.out.print(k+ " "); } What is printed as a result of executing the code segment?Q83.
What is the output of the following C code? #include < stdio.h > int main() { int index; for(index=1; index<=5; index++) { printf("%d", index); if (index==3) continue; } }Q84.
What will be the output of the following C program segment? char inChar = 'A' ; switch ( inChar ) { case 'A' : printf ("Choice A\ n") ; case 'B' : case 'C' : printf ("Choice B") ; case 'D' : case 'E' : default : printf ( " No Choice" ) ; }Q85.
Assume that X and Y are non-zero positive integers. What does the following Pascal program segment do? while X <> Y do if X > Y then X := X - Y else Y := Y - X; write(X);Q86.
Consider the following segment of C-code:int j, n; j = 1; while (j <= n) j = j * 2;The number of comparisons made in the execution of the loop for any n>0 is:Q87.
Consider the following program fragment if(a > b) if(b > c) s1; else s2;s2 will be executed ifQ88.
Given the programming constructs I. assignment II. for loops where the loop parameter cannot be changed within the loop III. if-then-else IV. forward go to V. arbitrary go to VI. non-recursive procedure call VII. recursive procedure/function call VIII. repeat loop, which constructs will you not include in a programming language such that it should be possible to program the terminates (i.e., halting) function in the same programming languageQ89.
Consider the following pseudo-codex:=1; i:=1; while (x <= 1000) begin x:=2^x; i:=i+1; end; What is the value of i at the end of the pseudo-code?Q90.
What will be the output of the following C code? #include < stdio.h > main() { int i; for(i=0;i<5;i++) { int i=10; printf("%d" , i); i++; } return 0; }