Here I post some basic C Interview questions.Most of the MNC are required only basic C quetions....
C Interview Questions
1. Describe about storage allocation and scope of global, extern, static, local and register variables?
2. Can we specify variable field width in a scanf() format string? If possible how?
3. What are the advantages of using pointers in a program?
4. Are the expressions arr and &arr same for an array of integers?
5. Can a Structure contain a Pointer to itself? Give an example
6. Why is my compiler complaining about an invalid redeclaration of a function that I define and call only once?
7. What is the difference between the following two declarations? Explain
Char a[];
Char *a;
8. What is the difference between arrays and pointers?
9. How can you determine the number of elements in an array, when sizeof yields the size in bytes?
10. I want to split a program into multiple source files. How should I do it?
11. What are header (“#include”) files searched for?
12. Can you convert numbers to strings? If so, how?
13. Write a program to count the number of words in a given file.
14. Write a program to extract a given word from a file.
15. Write a function to simulate the printf function in C
16. Examine the following code and explain.
For (I = start; I <> 7322
7322 seconds is equivalent to 2 hours 2 minutes 2 seconds.
Enter the number of seconds> 500
31. Write a program that reads in five integers and then determines and prints the largest and the smallest integers in the group.
32. Write a program to remove all comments from a C program.
33. Write a program that removes words from its input. The removed words are given as command line arguments. Write a function char *remove(char *line, char *word); that removes a word from a line. Be prepared to handle several removable words.
34. Write a program to copy its input to its output, replacing each tab by \t, and each backslash by \\. This makes tabs visible in an unambiguous way.
35. Write a program to read through an array of any type using pointer. Write a C program to scan through this array to find a particular value.
please tell me the answer of question no.16 .
ReplyDelete