Anda di halaman 1dari 13

1.What would be the equivalent pointer expression for referring the array element a[i][j][k][l] A.((((a+i)+j)+k)+l) B.*(*(*(*(a+i)+j)+k)+l) C.

(((a+i)+j)+k+l) D.((a+i)+j+k+l) 2. What is (void*)0? A.Representation of NULL pointer B.Representation of void pointer C.Error D.None of above

3.What is the output #include<stdio.h> int main() { int i=3, *j, k; j = &i; printf("%d\n", i**j*i+*j); return 0; } A. 30 B. 27 C. 9 D. 3

4.What will be the output of the program ? #include<stdio.h> int main() { char str[20] = "Hello"; char *const p=str; *p='M'; printf("%s\n", str); return 0; } A.Mello B.Hello C.HMello D.MHello

5. What will be the output of the program if the size of pointer is 4-bytes? #include<stdio.h> int main() { printf("%d, %d\n", sizeof(NULL), sizeof("")); return 0; } A.2, 1 B.2, 2 C.4, 1 D.4, 2

6.What will be the output of the program ? #include<stdio.h> int main() { printf("%c\n", 7["IndiaBIX"]); return 0; } A.Error: in printf B.Nothing will print print "X" of C. D.print "7" IndiaBIX

7. What will be the output of the program ? #include<stdio.h> int main() { char str[] = "peace"; char *s = str; printf("%s\n", s++ +3); return 0; } A.peace B.eace C.ace D.ce

8.What will be the output of the program ? #include<stdio.h> int main() { int k=1; printf("%d == 1 is" "%s\n", k, k==1?"TRUE":"FALSE"); return 0; } A.k == 1 is TRUE B.1 == 1 is TRUE C.1 == 1 is FALSE D.K == 1 is FALSE

9 What will be the output of the program ? #include<stdio.h> int main() { int a[5] = {5, 1, 15, 20, 25}; int i, j, m; i = ++a[1]; j = a[1]++; m = a[i++]; printf("%d, %d, %d", i, j, m); return 0; } A.2, 1, 15 B.1, 2, 5 C.3, 2, 15 D.2, 3, 20

10.What will be the output of the program? #include<stdio.h> int main() { char str[]="C-program"; int a = 5; printf(a >10?"Ps\n":"%s\n", str); return 0; } A.C-program B.Ps C.Error D.None of above

11.What will be the output of the program? #include<stdio.h> int main() { int i=-3, j=2, k=0, m; m = ++i && ++j && ++k; printf("%d, %d, %d, %d\n", i, j, k, m); return 0; } A.-2, 3, 1, 1 B.2, 3, 1, 2 C.1, 2, 3, 1 D.3, 3, 1, 2

12.What will be the output of the program? #include<stdio.h> int main() { float a=0.7; if(a < 0.7) printf("C\n"); else printf("C++\n"); return 0; } A.C B.C++ C.Compiler error D.Non of above

13.What will be the output of the program? #include<stdio.h> int main() { int a = 500, b = 100, c; if(!a >= 400) b = 300; c = 200; printf("b = %d c = %d\n", b, c); return 0; } A.b = 300 c = 200 B.b = 100 c = garbage C.b = 300 c = garbageD.b = 100 c = 200

14. What will be the output of the program? #include<stdio.h> int main() { int x = 3; float y = 3.0; if(x == y) printf("x and y are equal"); else printf("x and y are not equal"); return 0; } x and y are not A.x and y are equal B. equal C.Unpredictable D.No output

Anda mungkin juga menyukai