Functions
Q21.
What is the output in a 32 bit machine with 32 bit compiler? #include < stdio.h > rer(int **ptr2, int **ptr1) { int *ii; ii=*ptr2; *ptr2=*ptr1; *ptr1=ii; **ptr1*=**ptr2; **ptr2+=**ptr1; } void main(){ int var1=5, var2=10; int *ptr1=&var1,*ptr2=&var2 rer(&ptr1,&ptr2); printf("%d %d",var2,var1); }Q22.
What will be the output of the following C program? void count(intn){ static intd=1; printf("%d ",n); printf("%d ",d); d++; if(n>1) count(n-1); printf("%d ",d); } void main(){ count(3); }Q23.
Consider the following C program. void f(int,short); void main() { int i=100; short s=12; short *p=&s __________ ;//calltof() } Which one of the following expressions, when placed in the blank above, will NOT result in a typec hecking error?Q24.
Consider the following C program: #include int jumble(int x, int y) { x = 2 * x + y; return x; } int main() { int x = 2, y = 5; y = jumble(y, x); x = jumble(y, x); printf("%dn", x); return 0; } The value printed by program is __________ .Q25.
Consider the following C program: #include < stdio.h > int r(){ int static num=7; return num--; } int main() { for(r();r();r()) { printf("%d ",r()); }; return 0; } Which one of the following values will be displayed on execution of the programs?Q26.
Consider the following function void swap(int a, int b) { int temp; temp = a; a = b; b = temp; } In order to exchange the values of two variables x and y.Q27.
Consider the following C++ program int a (int m) {return ++m;} int b(int&m) {return ++m;} int{char &m} {return ++m;} void main() { int p = 0, q=0, r = 0; p += a(b(p)) ; q+= b(a(q);) r+=a(c(r)); cout << p << q << r; } Assuming the required header first are already included, the above programQ28.
Consider the following program written in pseudo-code. Assume that x and y are integers. Count(x,y) { if (y != 1){ if (x != 1) { print("*"); Count(x/2, y); } else { y = y-1; Count(1024, y); } } } The number of times that the print statement is executed by the call Count(1024,1024) is _____.