top of page
Writer's pictureAdmin

C Interview Questions and Answers for Freshers



In this answer, we will be discussing the most asked C programming interview questions during technical interview rounds of various companies. The below given C interview questions range from Easy to Advanced Level. Even if you are a beginner in C, these C programming tricky interview questions will help you understand and revise better.


1) What are the key features of the C programming language?

  • C is a platform-dependent language.

  • C offers the possibility to break down a large program into small modules.

  • Also, the possibility of a programmer controlling the language.

  • C comes with support for system programming and hence it compiles and executes with high speed when compared to other high-level languages.

2) What is the use of header files in C?

Header files contain the definitions and set of rules of the functions being used in the programs.

For example, when you use printf() or scanf() in your program, you need to include stdio.h library function. Else your compiler will show an error. This is because the standard input and output functions printf() and scanf() are stored in this header http://file. So similarly every header file stores a set of predefined functions which makes it easy to program.


3) Who developed the C Programming language?

A computer scientist named Dennis Ritchie from the USA developed the C programming language. He developed this with the help of his colleague Ken Thompson.


4) When was the C language invented?

It was invented in 1972.


5) Why is C known as the mother language?

It is the mother of most of the JVMs and compilers. Most of the languages use functions from this language. It has concepts like arrays, functions, file handling, etc.


6) Can a program be compiled without the main() function?

Yes, the compilation is possible, but the execution is not possible. However, if you use #define, we can execute the program without the need for main().For Example:

#include <stdio.h>

#define start main

void start()

{

printf("Hi");

}


7) What are the basic data types in C?

  • Int Used to represent a number (integer)

  • Float Used to represent a decimal number

  • Double Used to represent a decimal number with the highest precision(digits after the decimal point)

  • Char Single character

  • Void Special purpose type without any value

8) What is the difference between static & global variables?

Global variables are variables that are defined outside the function. The scope of global variables begins at the point where they are defined and lasts till the end of the file/program. Whereas, static global variables are private to the source file where they are defined and do not conflict with other variables in other source files which would have the same name.

A basic understanding of any of the programming languages will help you in understanding the C programming concepts. Read more interview questions for C programming.

Comments


bottom of page