Interview questions

C interview questions – page 44

2,094 questions. Tap “Show answer” to check yourself.

  1. Explain what a method is?

  2. Can constructors & destructor be virtual ?

  3. Explain about abstraction?

  4. Write a C program that will convert Simple Sentence to Complex/Compound Sentence.

  5. What is the function of % using in formatted string.

  6. What is wrong with the following c program?char *s1 = "hello";char *s2 = "world";char *s3 = strcat(s1, s2);Please provide me explanations?

  7. How to type a string without using printf function?

  8. WRITE A PROGRAM IN'C' TO IMPLEMENT K-MAP SIMPLIFICATION TECHNIQUE.

  9. Write A Program With Out Using ;

  10. How can you overload a method?

  11. How can you calculate number of nodes in a circular Linked List?

  12. Constant volatile variable declaration is possible or not? if give any one example and reason.

  13. What is static memory allocation and dynamic memory allocation?

  14. How do you mark a method obsolete?

  15. Would the following program compile? main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("n%u%u",j,k); }

  16. What is the difference between the functions rand(),random(),srand() and randomize()?

  17. Why does a linker error occurs for the segment:main(){extern int i;i=20;printf("%d",sizeof(i));}

  18. Where are the auto variables stored? What is the use of register variables?

  19. Explain about instance in object oriented programming?

  20. Assign a=56;how to separate that number(ie:5,6) and multiply(ie:5*6) using bitwise operator?

  21. What is use of macro arguments in c? what is major difference between normal macro definition and macro arguments.

  22. What do you mean by normalisation of pointers

  23. Differentiate between a linker and linkage?

  24. What are bit fields? What is the use of bit fields in a structure declaration?

  25. Can a variable be both const and volatile?

  26. Whats is structure padding? Say a given structureStruct{int a;char c;float d;}the size of structure is 7 here.But structure padding is done what will be the size of the struct? Will it change and how? How to avoid this?is it necessary?

  27. How would you qsort() function to sort an array of structures?

  28. How can we read/write structures from/to data files?

  29. What is the difference between far and near?

  30. How can you get the number of elements in an array allocated dynamically at runtime? For example -int *p = (int *) malloc(sizeof(int) * n);int numElems = ? /* n is not available here */

Companies that ask C questions