Previous Next

Interview Questions on C - Basics

1. Tell me History Of the C ?

The C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie to develop the UNIX operating system.
    

2. Write a sample Program in C?


#include <stdio.h>
int main()
{
   /* my first program in C */
   printf("Hello, World! \n");
   return 0;
}

3. Explain about Tokens in C?

1. C program consists of various tokens.
2. A token is either a keyword, an identifier, a constant, a string literal, or a symbol.
3. For example, the following C statement consists of five tokens: 
printf("Hello, World! \n");
4. The Tokens Are :
   1. printf
   2. (
   3. "Hello, World! \n"
   4. )
   5. ;

    

4. Which C Token we used for every individual statement as terminator?

Semicolon  ;
    

5. Tell me some key words or reserved words in C?

Int,
char,
float,
if,
else,
switch, 
case,
break,
goto,
continue,
do, 
while,
for 
    

6. What is the purpose Of Comments in C and How to write the comments in C?

 Comments are like helping text in your C program and they are ignored by the compiler. 
/* my first program in C */
    

7. What is Identifier and What are the Conditions to write an Identifier?

A C identifier is a name used to identify a variable, function, or any other user-defined item. 
1. An identifier starts with a letter A to Z or a to z or an underscore _ 
2. Second Character Onwards it can be  zero or more letters, underscores, and digits (0 to 9).
    
Previous Next