Thursday, September 22, 2016

C Programming Interview Question Set-1

  1. What is the output of following code?   printf("%5.2f",12345.6789);
  2. Justify following statement: Every line in C program must end with a semicolon.
  3. ++ and - - are known as __________operators.
  4. Justify following statement: The default case is compulsory in the switch case statement.
  5. What is the only function all C programs must contain?
  6. How to specify multi-line comments in C program?
  7. Justify following statement: Use of Comments reduces the speed of execution of a program.
  8. The statement printf (“%d”, ‘A’) would print the ________.
  9. Justify following statement: The line in C program may have more than one statements.
  10. The data type “int” requires _______ bytes in memory.
  11. The escape sequence character ______ causes the cursor to move to the next line on the screen.
  12. Justify following statement: The modulus operator (%) can be used only with integers.
  13. Mathematical functions such as sqrt, log, cos, etc. are available in _____________ header file.
  14. Justify following statement: In C programming, the statement a=a+1 and a+=1 will produce same result.
  15. Input output related functions such as printf, scanf , etc. are available in _____________ header file.
  16. Justify following statement: if and switch statements are examples of control statements in C.
  17. Find the output of following code:   int x=500,y=200;   printf("%d",( x > y ) ? x : y);
  18. What punctuation ends most lines of C code?
  19. The _________ variables can be accessed by any function in the program.
  20. Predict output of the following code:
  void main()  {
    int i=0;
    for(;i<5; i--)
      printf("%d", i);
  }

If you have any doubt about any question, then write in a comment area at the bottom of this page.

* * * * *

No comments:

Post a Comment