Sunday, 20 March 2016

C Interview Questions

 

C Interview Questions

This all the questions asked by the interviewers in interview. 

C Baics:-

  1. What is main() in c language.
  2. Write a C program without main.
  3. What is meant by <stdio.h> in c language.
  4. What is meant by # in c language?
  5. Write Hello World Program in c Language
  6. What is meant by Conditional statement in c and what are they?
  7. How many Loops in C and what are they?
  8. How many statements are there in c language?
  9. Data Types and it ranges in C languages.
  10. What are the constants?
  11. How many keywords and identifiers in c language?
  12. What is the different between ‘for’ and ‘while’ and do-while loops?
  13. Write a power of 2 program in c language.
  14. Write palindrome program in c (given number or string).
  15. Write c program to print 1 to many numbers without using for loops.
  16. Write c program to print reverse number in c.
  17. Define volatile variable in c language?
  18. Write a Prime number program in c language?
  19. Write a Fibonacci series program in c language?
  20. Write a Factorial program in c language?
  21. How many operators are there and what are they .Explain briefly?
  22. What is Type casting, how it works?
  23. What is meant by operator precedency?
  24. What is the return value of printf?
  25. what are the printf formats in c language?
  26. Explain about Go-To statement?
  27. Explain about do-while  loop?

Storage Classes:- 

  1. Explain briefly about Storage class in c?
  2. What is Extern variable? How to declare it?
  3. What is Static variable? How to declare it?
  4. What is Auto variable? How to declare it?
  5. What is Register variable? How to declare it?
  6. Wat is the different between Automatic variable and Integer variable?
  7. What does it mean a function declared as ‘static’?
  8. How extern variables is different from normal variables?
  9. Can we print the address of register variable?
  10. In what case can we use register variable?
  11. When do we declare the variable as ‘extern'?
  12. How to declare a ‘file scope function’?
  13. Define ‘static function’ properties?
  14. What is scope & storage allocation of extern and global variables? 
  15. What is scope & storage allocation of register,static and local variables?
  16. What is the storage memory, default value, scope and life of automatic, extern, static, register variables?

Compilation Stages:-

  1. What is meant by Compilation Stage?
  2. How many compilation stages are there?
  3. What is the difference between storage classes and storage sections in c?
  4. Which stage use which compilation ? What is the extension for each one?
  5. What are the properties of Loader?
  6. Explain about the stages and what each stage will give extension. 

Macros:-

  1. Explain user define and #define difference?
  2. What it meant by #define.
  3. What is meant by typedef?
  4. What is the difference between #define and typedef?
  5. Write a program to find out the given number is less than or greater than by using macros?

Arrays:-

  1. What is array?
  2. Difference between array [0] and &array [0].
  3. Define array of pointers and pointer to an array.
  4. What is meant by double dimension array? write an example program?
  5. How to accessing two dimensional array by using Pointer to an array?
  6. How to delete duplicate elements in array?
  7. Write array of pointers example program?
  8. Using single array reverse the order in array?
  9. How to create two dimensional array using double pointer?

Pointers:-

  1. What is a pointer ?
  2. Define pointer and what are the uses of pointer?
  3. How to allocate dynamic memory.
  4. Explain how many pointer in c and each and every one.
  5. Malloc return type, Calloc return type, Realloc return type?
  6. Explain constant pointer, pointer to constant and constant pointer to constant.
  7. Determine Endianness of your machine? Little-endian and Big-endian.
  8. Difference between NULL and VOID?
  9. How to allocate variable to a pointer?
  10. realloc(zero) means how much memory will allocate?

Functions:-

  1. Describe about Function?
  2. Define function and function pointer?
  3. What is meant by function definition and function declaration?
  4. Difference between call by value and call by reference in c? 
  5. Write function pointer program in c language?
  6. What is meant by function prototype? What is it uses?
  7. Write a program for nesting of function?
  8. Write a function recursion function?
  9. What is the scope and lifetime of variables in functions?

Strings:-

  1. Define string.
  2. Write program of pointer and array using stripy()?
  3. Write program of pointer and array using strstr()?
  4. Write program of pointer and array using strleng()?
  5. Write program of pointer and array using strrev()?
  6. Write program of pointer and array using strcmp()?
  7. Write program of pointer and array using strcat()?
  8. Explain and example program of memset()?
  9. Explain and example program of memcpy()?
  10. Explain and example program of  memmove()?
  11. Write program for upper case to lower case and lower case to upper case ASCII values?
  12. Write a program to get the string “123” converted as integer value 123?
  13. Write a program without using strcmpy,strcpy,strncpy.......?

Bit Manipulations:-

  1. What is meant by bit manipulations? When we use it?
  2. Which bitwise operator is suitable for checking whether a particular bit is ON or OFF?
  3. Which bitwise operator is suitable for tuning OFF a particular bit in a number?
  4. Write program macros using clear bit, set bit, toggle bit, show bit (Ternary operator using), Nibble Swap.
  5. Write program bit operation using odd or even number.
  6. Swapping two numbers without using third variable.

Linked lists:-

  1. What is a linked list?
  2. What are the parts of a linked list?
  3. How to create single linked list?
  4. How to create double linked list?
  5. Create linked list by add from starting, add from ending, add from middle?
  6. How to find middle node?
  7. Write a program for reverse linked list?
  8. How to create fining the loop in linked list?
  9. How to find last nth node?
  10. Write a circular linked list program?
  11. How to delete middle node in linked list?
  12. How to create double linked list?
  13. Deleting a node in double linked list.(starting ,middle, last)?
  14. Reverse a linked list in double linked list?

Structures and Unions:-

  1. What is Structure?
  2. What is union?
  3. What is the difference between structure and union?
  4. How to create structure and union? How to accessing it?
  5. How to accessing structure and union by using pointer variable?
  6. Explain self-referential structure in c?
  7. Example program of nested structure and union?
  8. What is the advantages of union?
  9. Explain padding?
  10. Without using size, how to print size of structure?
  11. What is an Enumeration constant?
  12. How can we use the  typedef in structures?
  13. How to over come padding?
  14. Write a program to print the union variables with in the structure?
  15. What is #pragma?

Stack:-

  1. Write program array using stack?
  2. Write program linked list using stack?
  3. What is FIFO and LIFO?
  4. How function stack will allocate in c?
  5. What is meant by stack and how it will work?
  6. What is push and pop?

-----------------------------------------------------------------------------------------

More details about C interview questions and programs: http://learnclanguage4.blogspot.com/

No comments:

Post a Comment

Structure

Defination :-                           Structure is a user defined data type. struct keyword is used to define a structure. Structur...