download Mastguru Android App

C Programming Questions Answers - Chapter 1 Online Quiz Test

  • 1. We can insert pre written code in a C program by using

    1. #read
    2. #get
    3. #include
    4. #put
  • 2. The first expression in a for loop is

    1. Step value of loop
    2. Value of the counter variable
    3. Any of above
    4. None of above
  • 3. Break statement is used for

    1. Quit a program
    2. Quit the current iteration
    3. Both of above
    4. None of above
  • 4. Continue statement used for

    1. To continue to the next line of code
    2. To stop the current iteration and begin the next iteration from the beginning
    3. To handle run time error
    4. None of above
  • 5. What will be output of
    #include
    void main()
    {
    char test =`S`;
    printf("\n%c",test);
    }

    1. S
    2. Error
    3. Garbage value
    4. None of above
  • 6. Due to variable scope in c

    1. Variables created in a function cannot be used another function
    2. Variables created in a function can be used in another function
    3. Variables created in a function can only be used in the main function
    4. None of above
  • 7. What will be the output of following program
    #include
    main()
    {
    int x,y = 10;
    x = y * NULL;
    printf(\"%d\",x);
    }

    1. error
    2. 0
    3. 10
    4. Garbage value
  • 8. Difference between calloc() and malloc()

    1. calloc() takes a single argument while malloc() needs two arguments
    2. malloc() takes a single argument while calloc() needs two arguments
    3. malloc() initializes the allocated memory to ZERO
    4. calloc() initializes the allocated memory to NULL
  • 9. Exit() is same as return

    1. TRUE
    2. FALSE
  • 10. calloc() belongs to which library

    1. stdlib.h
    2. malloc.h
    3. calloc.h
    4. None of above
  • 11. If include files can be nested

    1. Yes
    2. No
  • 12. Which of the following below is/are valid C keywords

    1. integer
    2. int
    3. null
    4. none of above
  • 13. total number of keywords in C are

    1. 30
    2. 32
    3. 48
    4. 132
  • 14. What is use of \r in c

    1. used to insert a vertical tab
    2. used to insert a tab
    3. places cursor at the end of line
    4. places cursor at the start of line
  • 15. Out of following program :
    float x = 10.7;
    int i;

    i = (int) x;
    print i;

    1. null
    2. error
    3. 10
    4. garbage value
  • 16. rand() function returns

    1. float value
    2. integer value
    3. any type
    4. none of above
  • 17. The compiler in C ignores all text till the end of line using

    1. //
    2. /
    3. */
    4. none of above
  • 18. Which operator in c can't be overloaded

    1. %
    2. +
    3. ::
    4. -
  • 19. Which operator has the highest priority

    1. ()
    2. []
    3. *
    4. /
  • 20. What is the purpose of getc()

    1. read a character from STDIN
    2. read a character from a file
    3. read all file
    4. read file random
Submit Quiz
Post a comment