Program Java
Program Java
#include <stdio.h>
void f(int);
void (*foo)(void) = f;
foo(10);
return 0;
void f(int i)
printf("%d\n", i);
#include <stdio.h>
int myfoo(int);
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
#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;
printf("%d\n", k);
a) -4
b) -5
c) 4
d) -3
#include <stdio.h>
int x = 0;
void main()
printf("%p\n", ptr);
ptr++;
a) 0 1
b) Compile time error
c) 0xbfd605e8 0xbfd605ec
d) 0xbfd605e8 0xbfd605e8
60)