Question Bank - C Programming

1. We can insert pre written code in a C program by using
  1.         #read
  2.         #get
  3.         #include
  4.         #put
Answer: Option 3

2. 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
Answer: Option 2

3. 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
Answer: Option 2

4. Exit() is same as return
  1.     TRUE
  2.     FALSE
Answer: Option 2

Common C Questions
C Programming Frequently Asked Interview Questions
C Programming Questions for Job Interview

5. Break statement is used for
  1.         Quit a program
  2.         Quit the current iteration
  3.         Both of above
  4.         None of above
Answer: Option 2

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
Answer: Option 1

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
Answer: Option 2

8. calloc() belongs to which library
  1.     stdlib.h
  2.     malloc.h
  3.     calloc.h
  4.     None of above
Answer: Option 1

9. If include files can be nested
  1.     Yes
  2.     No
Answer: Option 1

10. Which of the following below is/are valid C keywords
  1.     integer
  2.     int
  3.     null
  4.     none of above
Answer: Option 2


11. total number of keywords in C are
  1.     30
  2.     32
  3.     48
  4.     132
Answer: Option 2

12. 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
Answer: Option 4

13. Out of following program :
float x = 10.7;
int i;
i = (int) x;
print i;
  1.     null
  2.     error
  3.     10
  4.     garbage value
Answer: Option 3

14. rand() function returns
  1.     float value
  2.     integer value
  3.     any type
  4.     none of above
Answer: Option 2

15. The compiler in C ignores all text till the end of line using
  1.     //
  2.     /
  3.     */
  4.     none of above
Answer: Option 1

16. Which operator in c can't be overloaded
  1.     %
  2.     +
  3.     ::
  4.     -
Answer: Option 3

17. Which operator has the highest priority
  1.     ()
  2.     []
  3.     *
  4.     /
Answer: Option 1

18. 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
Answer: Option 2

19. Can getch() be used to echo the input
  1.     Yes
  2.     No
Answer: Option 2

20. If (*p) and **p is same
  1.     No
  2.     Yes
Answer: Option 1

Related

Variables in C 3611607516420079413

Post a Comment

SPAMMING will not be Appreciated.

emo-but-icon

Hot in week

Recent

Comments

Our Channel

Contact Us

Name

Email *

Message *

Follow by Email

item