55) What is the output of this C code?
#include <stdio.h>
void f(int);
void (*foo)(void) = f;
int main(int argc, char *argv[])
foo(10);
return 0;
void f(int i)
printf("%d\n", i);
a) Compile time error
b) 10
c) Undefined behaviour
d) None of the mentioned
56) What is the output of this C code?
#include <stdio.h>
void f(int (*x)(int));
int myfoo(int);
int (*foo)() = myfoo;
int main()
f(foo);
}
void f(int(*i)(int ))
i(11);
int myfoo(int i)
printf("%d\n", i);
return i;
a) 10 11
b) 11
c) 10
d) Undefined behavior
57) What is the output of this C code?
#include <stdio.h>
void main()
int x = 4;
int *p = &x;
int *k = p++;
int r = p - k;
printf("%d", r);
a) 4
b) 8
c) 1
d) Run time error
58) What is the output of this C code?
#include <stdio.h>
void main()
int a = -5;
int k = (a++, ++a);
printf("%d\n", k);
a) -4
b) -5
c) 4
d) -3
59) What is the output of this C code?
#include <stdio.h>
int x = 0;
void main()
int *const ptr = &x;
printf("%p\n", ptr);
ptr++;
printf("%p\n ", ptr);
a) 0 1
b) Compile time error
c) 0xbfd605e8 0xbfd605ec
d) 0xbfd605e8 0xbfd605e8
60)