Assumptions 1. The generic function print() sends its arguments to the default output stream 2. The given blocks of code are a part of a class (Java, C++) and a file in C. 3. Print ( ) always prints with a new line.
Section 2: Technical 1) What will be the result of the following code? int i; for(i = 0; i 9); print(sum);
6) What will be the result of the following code? int a = 4, b = 0; if (a > 5) { b = 4; } else if (a < 10) { b = 3; } else if (a < 5) { b = 2; } else { b = 1; } print(b);
7) What will be the result of the following code? int i = 6720, j = 4; while((i % j) == 0) { i = i / j; j = j + 1; } print(j);
8) What will be the return value on calling the function checksum(5)? int checksum(int n) { int c; if(n == 1) return(1); else c = n * checksum(n - 1); return(c); }
9) What will be the result of the following code? int i, x; for(i = 1; i > (2 + 1 - 2)) | (1 x) print("First"); else print("Second"); if (2 > x) print("Third"); print("Fourth"); print("Fifth");
12) What will be the result of the following code? int a = 1; while (a
Thank you for interesting in our services. We are a non-profit group that run this website to share documents. We need your help to maintenance this website.