Home / C Programming / C Fundamentals :: C Fundamentals

C Programming :: C Fundamentals

  1. If integer needs two bytes of storage, then maximum value of an unsigned integer is

  2. A.

     216 – 1

    B.

     215 – 1

    C.

     216

    D.

     215

    E.

     None of these

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. What is the correct value to return to the operating system upon the successful completion of a program?

  4. A.

     1

    B.

     -1

    C.

     0

    D.

     Program do no return a value.

    E.

     2

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. Which is the only function all C programs must contain?

  6. A.

     start()

    B.

     system()

    C.

     main()

    D.

     printf()

    E.

     getch()

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Which of the following is not a correct variable type?

  8. A.

     float

    B.

     real

    C.

     int

    D.

     double

    E.

     char

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. What number would be shown on the screen after the following statements of C are executed?

    char ch;

    int i;

    ch = 'G';

    i = ch-'A';

    printf("%d", i);

  10. A.

     5

    B.

     6

    C.

     7

    D.

     8

    E.

     9

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. Which of following is not a valid name for a C variable?

  12. A.

     Examveda

    B.

     Exam_veda

    C.

     Exam veda

    D.

     Both A and B

    E.

     None of these

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Find the output of the following program. void main() { int i=01289; printf("%d", i); }

  14. A.

     0289

    B.

     1289

    C.

     713

    D.

     0713

    E.

     Syntax error

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. Find the output of the following program.

    void main()

    {

    int i=065, j=65;

    printf("%d %d", i, j);

    }

  16. A.

     53 65

    B.

     65 65

    C.

     065 65

    D.

     053 65

    E.

     Syntax error

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. If ASCII value of 'x' is 120, then what is the value of the H, if
    H = ('x' – 'w' ) / 3;

  18. A.

     1

    B.

     2

    C.

     3

    D.

     4

    E.

     0

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. What is the difference between a declaration and a definition of a variable?

  20. A.

     Both can occur multiple times, but a declaration must occur first.

    B.

     A definition occurs once, but a declaration may occur many times.

    C.

     Both can occur multiple times, but a definition must occur first.

    D.

     A declaration occurs once, but a definition may occur many times.

    E.

     There is no difference between them.

    View Answer

    Workspace

    Discuss Discuss in Forum