Play and learn 300 000+ tabs online

Thursday, August 12, 2010

C Interview Programs

  1. Are expressions arr and *arr same for array of integers?
  2. Are variables argc and argv are local to main?
  3. Bitwise operator for checking whether particular bit is on or off?
  4. Bitwise operator for putting on particular bit in number?
  5. Bitwise operator for turning off particular bit in number?
  6. Can Structure contain Pointer to itself?
  7. Can there be at least some solution to determine number of arguments passed to variable argument list function?
  8. Can we specify variable field width in scanf() format string? If possible how?
  9. Can you dynamically allocate arrays in expanded memory?
  10. Can you use function fprintf() to display output on screen?
  11. Can you write function similar to printf()?
  12. Describe about storage allocation and scope of global, extern, static, local and register variables?
  13. Difference : Strings and Arrays?
  14. Difference : Structure and Unions?
  15. Difference : arrays and linked list?
  16. Difference : enumeration and set of pre-processor # defines?
  17. Difference : functions memmove() and memcpy()?
  18. Difference : functions rand(), random(), srand() and randomize()?
  19. Difference : main() in C and main() in C++?
  20. Difference : pass by reference and pass by value?
  21. Difference : strdup and strcpy?
  22. Differentiate between for loop and while loop? it uses?
  23. Does mentioning array name gives base address in all contexts?
  24. Does there exist any other function that can be used to convert integer or float to string?
  25. Does there exist any way to make command line arguments available to other functions without passing them asarguments to function?
  26. Explain one method to process entire string as one unit?
  27. How are Structure passing and returning implemented by complier?
  28. How can called function determine number of arguments that have been passed to it?
  29. How can we check whether contents of two structure variables are same or not?
  30. How can we read/write Structures from/to data files?
  31. How much maximum can you allocate in single call to malloc()?
  32. How will you declare array of three function pointers where each function receives two ints and returns float?
  33. If we want that any wildcard characters in command line arguments should be appropriately expanded, are we required to make any special provision? If yes, that?
  34. In header file whether functions are declared or defined?
  35. In header files whether functions are declared or defined?
  36. Increase size of dynamically allocated array?
  37. Increase size of statically allocated array?
  38. Out of fgets() and gets() that function is safe to use and why?
  39. Program : compare two strings without using strcmp() function.
  40. Program : concatenate two strings.
  41. Program : find Factorial of number.
  42. Program : generate Fibonacci Series?
  43. Program : interchange variables without using third one.
  44. Program : s for String Reversal. same for Palindrome check.
  45. Program : that employs Recursion?
  46. Program : that uses command line arguments.
  47. Program : that uses functions like strcmp(), strcpy(), etc.
  48. To that numbering system can binary number be easily converted to?
  49. Use bsearch() function to search name stored in array of pointers to string?
  50. Use functions fseek(), freed(), fwrite() and ftell()?
  51. Use functions memcpy(), memset(), memmove()?
  52. Use functions randomize() and random()?
  53. Use functions sin(), pow(), sqrt()?
  54. Use qsort() function to sort array of structures?
  55. Use qsort() function to sort name stored in array of pointers to string?
  56. What advantages of using Unions?
  57. What do functions atoi(), itoa() and gcvt() do?
  58. What do ‘c’ and ‘v’ in argc and argv stand for?
  59. What does error ‘Null Pointer Assignment’ mean and what causes this error?
  60. What does static variable mean?
  61. What is NULL Macro? Difference : NULL Pointer and NULL Macro?
  62. What is NULL Pointer? Whether it is same as uninitialized pointer?
  63. What is far pointer? where we use it?
  64. What is linklist and why do we use it when we have arrays? – I feel correct answer should be linklist is used in cases where you don’t know memory required to store data structure and need to allocate is dynamically on demand.
  65. What is maximum combined length of command line arguments including space between adjacent arguments?
  66. What is near, far and huge pointers? How many bytes are occupied by them?
  67. What is object file? How can you access object file?
  68. What is pointer?
  69. What is recursion?
  70. What is similarity between Structure, Union and enumeration?
  71. What is static identifier?
  72. What is structure?
  73. What is use of typedef?
  74. When reallocating memory if any other pointers point into same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
  75. Where are auto variables stored?
  76. Where does global, static, local, register variables, free memory and C Program instructions get stored?
  77. Write down equivalent pointer expression for referring same element a[i][j][k][l]?
  78. advantages of using pointers in program?
  79. advantages of using typedef in program?
  80. bit fields? What is use of bit fields in Structure declaration?
  81. declare following: array of three pointers to chars, array of three char pointers, pointer to array of three chars, pointerto function that receives int pointer and returns float pointer, pointer to function that receives nothing and returns nothing
  82. detect loop in linked list?
  83. differences between malloc() and calloc()?
  84. differences between structures and arrays?
  85. different storage classes in C?
  86. dynamically allocate one-dimensional and two-dimensional array of integers?
  87. enumerations?
  88. implement substr() function that extracts sub string from given string?
  89. macros? advantages and disadvantages?
  90. obtain current time and Difference : two times?
  91. obtain segment and offset addresses from far address of memory location?
  92. print string on printer?
  93. register variables? advantage of using register variables?
  94. that function should be used to free memory allocated by calloc()?
  95. that header file should you include if you are to develop function that can accept variable number of arguments?

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.