Interview questions

C interview questions – page 33

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

  1. If the following program (myprog) is run from the command line as myprog 1 2 3, What would be the output? main(int argc, char *argv[]) { int i,j=0; for(i=0;i<argc;i++) j=j+ atoi(argv[i]); printf("%d",j); }

  2. What will be the output of the following program in UNIX OS with CC compiler and TC compiler?int main(){int i=5;printf("%d",++i + ++i + ++i + ++i + ++i );}If any difference then Why it is difference?

  3. What is modular programming?

  4. If the program (myprog) is run from the command line as myprog 1 2 3 , What would be the output? main(int argc, char *argv[]) { int i; for(i=0;i<argc;i++) printf("%s",argv[i]); }

  5. Why should I prototype a function?

  6. How to remove duplicate elements from an array

  7. To which numbering system can the binary number 1101100100111100 be easily converted to?

  8. What is the Datagird ?

  9. What is Thread? Use of Threads in c#.

  10. Main(){int x=5;clrscr();for(;x<= 0;x--){printf("x=%d ", x--);}}

  11. What are comment line arguments in C programiing? and also give an example.

  12. #include<conio.h>main(){int x,y=2,z,a;if(x=y%2) z=2;a=2;printf("%d %d ",z,x);}

  13. What is a multicast delegate?

  14. What do the functions atoi(),itoa()and gctv()do?

  15. Define a class named cord, a point in Cartesian coordinate system where each point has two int type values x and y. Your class must contain necessary constructors and arithmetic operator functions. Write necessary codes to test your class?

  16. Main(){signed int bit=512, i=5;for(;i;i--){printf("%dn", bit = (bit >> (i - (i -1))));}}

  17. What are advantages and disadvantages of external storage class?

  18. Explain one method to process an entire string as one unit?

  19. Can you store multiple data types in System.Array?

  20. Why would you use untrusted verificaion?

  21. Main(){char *p;printf("%d %d ",sizeof(*p),sizeof(p));}

  22. How i can run *.bat or *.cmd file by using system function in c ?

  23. Are pointers integers?

  24. What are the problems faced by the developer using object oriented programming language?

  25. What's the top .NET class that everything is derived from?

  26. How can you determine the size of an allocated portion of memory?

  27. What is an argument ? differentiate between formal arguments and actual arguments?

  28. What's wrong with this code? Char*p*p=malloc(10);

  29. Why are there five tracing levels in System.Diagnostics.TraceSwitcher?

  30. Main(){float me = 1.1;double you = 1.1;if(me==you)printf("I love U");elseprintf("I hate U");}

Companies that ask C questions