Interview questions

C interview questions – page 32

2,094 questions. Tap “Show answer” to check yourself.

  1. It is not possible to debug the classes written in other .Net languages in a C# project.

  2. Bool data type in C# is

  3. If we want that any wildcard characters in the command line argument should be approxiemately expanded , are we required to make any special provision?if yes, which?

  4. The following is the namespace used for Reflection:

  5. Explain about parametric polymorphism?

  6. Void main(){int const * p=5;printf("%d",++(*p));}

  7. What would be the output of the following program? main() { int y=128; const int x=y; printf("%d",x); }

  8. Main(){int i, j;scanf("%d %d"+scanf("%d %d", &i, &j));printf("%d %d", i, j);}

  9. In the following code, in which order the functions would be called?x = f1(23,14)*f2(12/4)+f3();a) f1, f2, f3 b) f3, f2, f1c) The order may vary from compiler to compiler d) None of the above

  10. Vii)7. main(){int i=-1,j=-1,k=0,l=2,m;m=i++&&j++&&k++||l++;printf("%d %d %d %d %d",i,j,k,l,m);}

  11. Main(){int x=5;for(;x!=0;x--) {printf("x=%dn", x--);}}

  12. Main(){char * strA;char * strB = I am OK;memcpy( strA, strB, 6);}

  13. In which line of the following, an error would be reported? 1. #define CIRCUM(R) (3.14*R*R); 2. main() 3. { 4. float r=1.0,c; 5. c= CIRCUM(r); 6. printf("n%f",c); 7. if(CIRCUM(r))==6.28) 8. printf("nGobbledygook"); 9. }

  14. GIVEN TWO ONE DIMENSIONAL ARRAYS A AND B WHICH ARE SORTED IN ASSCENDING ORDER.WRITE A PROGRAM TO MERGE THEM INTO A SINGLE SORTED ARRAY ,C THAT CONTAINS EVERY ITEM FROM ARRAYS A AND B,IN ASCENDING ORDER.

  15. How would you use qsort() function to sort the name stored in an array of pointers to string?

  16. Main(){int i, j, *p;i = 25;j = 100;p = &i; // Address of i is assigned to pointer pprintf("%f", i/(*p) ); // i is divided by pointer p}

  17. In the following code, what is p2? typedef int* ptr ptr p1, p2;

  18. What is the difference between null array and an empty array?

  19. Union u{ struct st { int i : 4; int j : 4; int k : 4; int l; }st; int i;}u;main(){ u.i = 100; printf("%d, %d, %d",u.i, u.st.i, u.st.l);}

  20. Main(){int i =10, j = 20;clrscr();printf("%d, %d, ", j-- , --i);printf("%d, %d ", j++ , ++i);}

  21. Main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; }

  22. Main(){char *a = "Hello ";char *b = "World";clrscr();printf("%s", strcat(a,b));}

  23. Main(){int i=3;switch(i){default:printf("zero");case 1: printf("one");break;case 2:printf("two");break;case 3: printf("three");break;} }

  24. Void main(){ float a= 0.7; if (a < 0.7) printf("c"); else printf("c++");} Output of the above program is c. Why? Whereas the same program with 0.8 instead of 0.7 gives c++ as the output? Why explain?

  25. What is constructor and virtual function?

  26. What is a satellite assembly?

  27. Write a c program for delete a node from linked list?

  28. Union u{union u{int i;int j;}a[10];int b[10];}u;main(){printf("n%d", sizeof(u));printf(" %d", sizeof(u.a));// printf("%d", sizeof(u.a[4].i));}

  29. What is the output of the following program?#define SQR(x) (x*x)main(){ int a,b=3; a= SQR(b+2); printf("%d",a);}

  30. Main(){char *a = "Hello ";char *b = "World";clrscr();printf("%s", strcpy(a,b));}

Companies that ask C questions