C Interview Questions and Answers For Freshers / Experienced - Important Quiz 

In this section, I have selected Basic and Important C interview questions and answers for all levels of candidates(Fresher level, advanced level,experienced level).
Last few months I have been working to select best question and answer set for C interview questions.

Here is some Important C Interview Questions and Answers for freshers and experienced:

1.Can we have a pointer to a pointer in C?

Answer: Yes

char *a;      -   Pointer to a character

char **a;      -    Pointer to a pointer

2.How to convert strings in c to corresponding Integer?

Answer:
atoi() function convert a string into corresponding integer value.use stdlib.h header file.

3. C Data types?
Answer :Int, char, float, void etc. are predefined basic primitive data types.Structures and Unions are user defined data types.

4.Find the output of the following program? 
#include 
main() 

int i=10; 
printf("%d",++i); 
printf("%d",i++); 
printf("%d",(i++*i++)) 


5.Octal literal in C?
#include
main()
{
int i=020;
printf("i is %d",i);
}
Output:16

Answer :
In c and c ++ language 0 (zero) is the octel literal so it will print its Octel representation of 16.

6.Whats is difference between file descriptor and file pointer?

7.Two forms of #include directive?
Answer :
1.#include”filename”
2.#include

8.Find the output of the following program? 
#include 
main()

    int str=0; 
    if(str==0) 
        printf("True"); 
printf("False"); 
}
Answer :
True
False

9.Find the output of the following program? 
#include 
main()

    int x=0; 
    if(x==0) 
        printf("True"); 
else
printf("False"); 
}

Answer :
True

10.What will be the Output of the following program? 
#include
main()

    int i=50, j=100; 
    i = j++; 
    j = ++j; 
    printf("%d %dn",i,j);
}

Answer :
51, 101

11.What will be the Output of the following program? 

#include
main()
{
int i = 10;
printf("%d", main||i);
}

Answer :
1

12. Write a Program to convert decimal to binary number?
Answer :
#include
main()
{
int x,y,n,arr[50];
clrscr();
printf("Enter the decimal number");
scanf("%d",n);
for(x=0;x
{
arr[x]=n%2;
n=n/2;
}
for(y=n;y>0;y--)
{
printf("%d",arr[y]);
}
getch();
}

Top Important C FAQs and Interview Questions

  1. What is the difference between strings and character arrays?
  2. Differences between pass by reference and pass by value?
  3. What does static variable mean?
  4. What is the use of semicolon at the end of every statement?
  5. What is a null pointer?
  6. What is a pointer?
  7. When would you use a pointer to a function?
  8. What are the uses of a pointer?
  9. In header files whether functions are declared or defined?
  10. What are the differences between malloc () and calloc ()?
  11. What is the heap?
  12. What is the stack?
  13. Difference between const char* p and char const* p?
  14. What is a structure?
  15. What is a union?
  16. What is Operator overloading ?
  17. What is a void pointer?
  18. What is hashing?
  19. What are the different storage classes in C?
  20. What are the differences between structures and union?
  21. What is the difference between calloc() and malloc()?
  22. What are the differences between structures and arrays?
  23. What is the difference between printf() and sprintf()?
  24. What is static memory allocation and dynamic memory allocation?
  25. Define recursion in C?
  26. What is the use of typedef?
  27. How are pointer variables initialized?
  28. What are the advantages of auto variables?