C Interview Questions For Students and Freshers

by admin on August 17, 2012

Programming language is basically a series of instructions given to the computer to perform a particular task. Every language defines a set of rules in writing these instructions. C is one of the programming languages and belongs to High level language. It was developed by Dennis Ritchie in 1970’s. The power of this language is that it is still used in writing many operating systems. Because of its simplicity, it becomes essential for every programmer to be aware of this language in depth and in detail.

This article covers some of the questions asked in the interview to check the knowledge of the user in C.

  • Write a simple program to create a multi- dimensional array
  • What is advantage of using #define
  • What is the difference between ++ before a variable and after a variable: e.g ++2 and 2++?
  • In a macro if va_start is called in the beginning, does the va_end has to be called at the end?
  • What is the return from

Int testarr [4];

Return (&testarr [2] <&testarr [4]);

Given data testarr =[5,2,4,7]

    • What is ‘c’ and ‘v’ in argc and argv?

    • Explain the difference between malloc() and calloc()
    • How to find the memory size of  a variable without using sizeof()
    • Explain const pointer
    • What is a preprocessor
    • what does void(*tmp)();
    • Which cannot be handled in switch-case statement?
    • Explain the advantage of Do- while loop as compared with do loop
    • Is C a structural language or procedural language?
    • With a simple program explain the usage and difference of break and continue statements
    • Do macros have  local scope  or global scope
    • Explain the levels of indirection in a single declaration
    • Explain the difference between declaring a variable and defining a variable
    •  A program to print an address
    • Is it possible to point structure to itself?
    • What will happen if a function has two return statements successively?
    • How to free the memory allocated by calloc()
    • How to override a defined macro
    • what is a pointer to a function
    • Why and where ‘static keyword is used?
    • What is meant by laxical analysis?
    • What is meant by built in function?
    • A program to print a word given by user say around 5 times without using any loops
    • Is any memory is reserved when a structure is declared?
    • How to track the X-Y co-ordinates of mouse pointer
    • How to reverse an array without using any buffers
    • Can two pointers be added together? If so what will be the output. Explain with a set of numbers
    • What does a Null pointer returns
    • What does atoi does?
    • A program to check whether a given string is a palindrome

  • Do the array need to be initialized at the time of declaration ?
  • In command line do we need to pass the argument count as first parameter along with other argument values?
  • Can the bitfields used inUNION?
  • Which library function used to find the last occurrence of a charater in a string
  • How to print \n
  • What is the difference between randomize () and random ()?
  • Can you access object file?
  • Can c language be used to implement graphics?
  • How to make a function reentrant
  • In C is it possible to call a function with argument list built up during the run time
  • Swapping two variables without using a temp or third variable
  • what happens to a statement in the absence of semicolon at the end
  • Do all the header files should have .h extension?
  • What happens to the print statement with void : e.f (void) printf();
  • How to typedef  a structure
  • how to check if a link list is circular
  • Dynamically allocate 2D array using only 1 malloc
  • Explain how free() deallocates memory
  • Why overloading is not supported by C
  • When to use a volatile modifier
  • Which is the quickest sorting method
  • explain the advantage of using union over structure and state the differences between the two
  • How the auto variables are stored
  • Explain the pupose of main() function
  • Write Fibonacci series using iterative implementation
  • What will be the output of the following code?

#include <stdio.h>

Void main ()


Char buf[5] =”Aunty”;



  • Using bitwise operator exchange two numbers
  • Write a program to delete a particular line from a given file
  • How to convert a given number into string
  • explain heap
  • What is a register storage class
  • What is a dangling pointer
  • what is function prototyping
  • How to make a function return more than one value?
  • What are the command line arguments?
  • What are the type of linkages in C
  • Which built in function is used to round off a number in c
  • write a program to check the given number if it odd or even?
  • Given a number write a program to display the multiplication table of the number
  • What is the difference between the two statements:

Char *str = “testing”;

Char arr[] = “testing”;

  • What is the output of the following program:
    • Arr++;
    • *(arr+1)=’f’;
    • Printf(“%s”,arr);
  • Write a program to print the following output:





Until the alphabet Z


    • What is the advantage of passing by reference rather than passing by value?

  • What is strdup()?
  • Explain the difference between NULL and NUL
  • Explain the difference between global int and static int
  • How to return a valid memory address using malloc()
  • How to print a semicolon without using a semicolon
  • Is it possible to crash a process without entering the main function?
  • Explain page thrashing
  • What is meant by cyclic property of a data type?
  • In header file, are the functions declared or defined?
  • How to dynamically allocate an array when copying strings in a given program
  • Define wild pointer
  • What is a static identifier
  • Declare an array of three function pointers where each function receives two integers and returns float
  • Which type of language C belongs to?
  • Explain the purpose of realloc
  • write a program to concatenate two strings without using strcat()
  • Find the factorial of a number using a program
  • Explain the difference between #include <file> and #include? File??
  • How to reduce the size of executable?
  • Where is fflush () used?
  • Explain #pragma directives
  • What does self-referential structure means?

Related posts:

  1. ECE Interview Questions For Freshers
  2. Interview Questions For Freshers
  3. Digital Electronics Interview Questions
  4. Basic Electronics Interview Questions
  5. Mechanical Engineering Interview Questions

Next post: