If you are a beginner and going for job Interview, where you can be asked C language questions by Interviewer then you are on right place, in this article we will provide you C language Interview questions and C programming coding questions.

What are the C programming language features?

  • Fast & Efficient: Programs Written in C are efficient and fast. This is due to its variety of data type and powerful operators.
  • Portable: C can run on any machine with little or no modifications.
  • Low level programming readily available
  • Structured: It divides the problem into smaller modules called functions or procedures.
  • Extensible: C is an extensible language as it can adopt new features.
  • It has high-level constructs.
  • The C compiler combines the capabilities of an assembly language with features of a high-level language.

What are the return values of printf and scanf?

printf returns the number of characters it prints while scanf returns the number of items it has successfully read, if there is some input failure or error then it returns EOF.

What is difference between i++ and ++i?

i++ is known as Post-Increment in which first value is used and then incremented

++i is called Pre-Increment in which value is first incremented and then used.

What is Volatile keyword in C?

volatile keyword in C, came into existence for the purpose of not caching the values of the variable automatically.

It will tell the compiler not to cache the value of this variable. So it will generate code to take the value of the given volatile variable from the main memory every time it encounters it.

Variables declared as volatile are omitted from optimization because their values can be changed by code outside the scope of current code at any time.

What is dangling pointer in C? 

If a pointer is pointing to memory that is not owned by your program (except the null pointer ) or an invalid memory, the pointer is called a dangling pointer.

In the program, we should not use the dangling pointer. It can be the cause of memory faults.




int *call();
int main() {

  int *ptr;
  ptr = call();

  printf("%d", *ptr);
  return 0;

int * call() {
  int x=25;

  return &x;

Its output will be garbage because the variable x is a local variable. Its scope and lifetime are within the function call hence after returning the address of x variable x becomes dead and the pointer is still pointing to that location.

What is wild pointer in C?

The pointers which points to arbitrary memory location which makes your program behave badly, are called wild pointer. In Other words, A Pointer in C that has not been initialized till its first use is known as Wild pointer.


int main() {
  int  *ptr;
  /* Ptr is a wild pointer, as it is not initialized Yet */
  printf("%d", *ptr);

Write a program in C to Swap two variables without using third variable.

int main(){
    int a=5,b=10;


    printf("a= %d  b=  %d",a,b);

Print Hello World without using semicolon (;)

void main(){
    if(printf("Hello world")){