C-Language Interview Questions
1 .
What is translation unit?
A translation unit is a set of files seen by the compiler.

It includes the source code under consideration and files that are included such as header files and other disk files contain C code.
2 .
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
<> is incorrect. While this operator is correctly interpreted as "not  equal to" in writing conditional statements, it is not the proper operator to be used in C programming. Instead, the operator  !=  must be used to indicate "not equal to" condition.
3 .
What are preprocessor directives?
Preprocessor directives are placed at the beginning of every C program. This is where library files are specified, which would depend on what functions are to be used in the program. Another use of preprocessor directives is the declaration of constants.Preprocessor directives begin with the # symbol.
4 .
What is a newline escape sequence?
A newline escape sequence is represented by the \n character. This is used to insert a new line when displaying data in the output screen. More spaces can be added by inserting more \n characters. For example, \n\n would insert two spaces. A newline escape sequence can be placed before the actual output expression or after.
5 .
What are control structures?
Control structures take charge at which instructions are to be performed in a program. This means that program flow may not necessarily move from one statement to the next one, but rather some alternative portions may need to be pass into or bypassed from, depending on the outcome of the conditional statements.
6 .
What does the function toupper() do?
It is used to convert any letter to its upper case mode. Toupper() function prototype is declared in <ctype.h>. Note that this function will only convert a single character, and not an entire string.
7 .
What is the difference between text files and binary files?
Text files contain data that can easily be understood by humans. It includes letters, numbers and other characters. On the other hand, binary files contain 1s and 0s that only computers can interpret.
8 .
Are comments included during the compilation stage and placed in the EXE file as well?
No, comments that were encountered by the compiler are disregarded. Comments are mostly for the guidance of the programmer only and do not have any other significant use in the program functionality.
9 .
What are multidimensional arrays?
Multidimensional arrays are capable of storing data in a two or more dimensional structure. For example, you can use a 2 dimensional array to store the current position of pieces in a chess game, or position of players in a tic-tac-toe program.
10 .
Write a simple code fragment that will check if a number is positive or negative.
If (num>=0)
printf("number is positive");

printf ("number is negative");