Question Bank - C Programming
http://ingenuitydias.blogspot.com/2016/08/question-bank-c-programming.html
1. We can insert pre written code in a C program by using
2. Difference between calloc() and malloc()
3. The first expression in a for loop is
4. Exit() is same as return
Common C Questions
C Programming Frequently Asked Interview Questions
C Programming Questions for Job Interview
5. Break statement is used for
6. Due to variable scope in c
7. What will be the output of following program
#include
main()
{
int x,y = 10;
x = y * NULL;
printf(\"%d\",x);
}
8. calloc() belongs to which library
9. If include files can be nested
10. Which of the following below is/are valid C keywords
11. total number of keywords in C are
12. What is use of \r in c
13. Out of following program :
float x = 10.7;
int i;
i = (int) x;
print i;
14. rand() function returns
15. The compiler in C ignores all text till the end of line using
16. Which operator in c can't be overloaded
17. Which operator has the highest priority
18. What is the purpose of getc()
19. Can getch() be used to echo the input
20. If (*p) and **p is same
- #read
- #get
- #include
- #put
2. Difference between calloc() and malloc()
- calloc() takes a single argument while malloc() needs two arguments
- malloc() takes a single argument while calloc() needs two arguments
- malloc() initializes the allocated memory to ZERO
- calloc() initializes the allocated memory to NULL
3. The first expression in a for loop is
- Step value of loop
- Value of the counter variable
- Any of above
- None of above
4. Exit() is same as return
- TRUE
- FALSE
Common C Questions
C Programming Frequently Asked Interview Questions
C Programming Questions for Job Interview
5. Break statement is used for
- Quit a program
- Quit the current iteration
- Both of above
- None of above
6. Due to variable scope in c
- Variables created in a function cannot be used another function
- Variables created in a function can be used in another function
- Variables created in a function can only be used in the main function
- None of above
7. What will be the output of following program
#include
main()
{
int x,y = 10;
x = y * NULL;
printf(\"%d\",x);
}
- error
- 0
- 10
- Garbage value
8. calloc() belongs to which library
- stdlib.h
- malloc.h
- calloc.h
- None of above
9. If include files can be nested
- Yes
- No
10. Which of the following below is/are valid C keywords
- integer
- int
- null
- none of above
11. total number of keywords in C are
- 30
- 32
- 48
- 132
12. What is use of \r in c
- used to insert a vertical tab
- used to insert a tab
- places cursor at the end of line
- places cursor at the start of line
13. Out of following program :
float x = 10.7;
int i;
i = (int) x;
print i;
- null
- error
- 10
- garbage value
14. rand() function returns
- float value
- integer value
- any type
- none of above
15. The compiler in C ignores all text till the end of line using
- //
- /
- */
- none of above
16. Which operator in c can't be overloaded
- %
- +
- ::
- -
17. Which operator has the highest priority
- ()
- []
- *
- /
18. What is the purpose of getc()
- read a character from STDIN
- read a character from a file
- read all file
- read file random
19. Can getch() be used to echo the input
- Yes
- No
20. If (*p) and **p is same
- No
- Yes