Question 31
int a (int m) {return ++m;} int b(int&m) {return ++m;} int c(char &m) {return ++m;} void main 0 { int p = 0, q = 0, r = 0; p += a(b(p)); q += b(a(q)); r += a(c(r)); cout<Assuming the required header files are already included, the above program:
Question 32
main (){ int x = 2, y = 5; if(x < y) return (x = x + y); else printf ("z1"); printf("z2");
Question 33
main() { int x = 1; printf ("%d", (*char(char *)&x)) ; }Assuming required header files are included and if the machine in which this program is executed is little-endian, then the output will be
Question 34
#includeHow many lines of output does this program produce?main() { float sum = 0.0, j =1.0, i = 2.0; while(i/j > 0.001) { j = j + 1; sum = sum + i/j; printf ( "%f\\n", sum ); } }
Question 35
void swap (int a, int b) { int temp; temp = a; a = b; b = temp; } int main( ) { int p = 0, q = 1; swap (p, q); }(b)
void swap (int &a, int &b) { int temp; temp = a; a = b; b = temp; } int main( ) { int p = 0, q = 1; swap (p, q); }(c)
void swap (int * a, int * b) { int * temp; temp = a; a = b; b = temp; } int main( ) { int p = 0, q = 1; swap (&p, &q); }Which of these would actually swap the contents of the two integer variables p and q?
Question 36
Question 40
int fun(){ static int num = 16; return num--;}int main(){ for(fun(); fun(); fun()) printf(\"%d \", fun()); return 0;}
There are 41 questions to complete.