What is a command-line argument?
The argument passed to the main() function while executing the program is known as the command-line argument. For example:
main(int count, char *args[]){
//code to be executed
}
What is Preprocessor?
A Preprocessor Directive is considered as a built-in predefined function or macro that acts as a directive to the compiler and it gets executed before the actual C Program is executed.
What is the main difference between the Compiler and the Interpreter?
The compiler is used in C Language and it translates the complete code into the Machine Code in one shot. On the other hand, Interpreter is used in Java Programming Langauge and other high-end programming languages. It is designed to compile code in a line-by-line fashion.
What are the valid places for the keyword break to appear?
A break can appear only within the looping control and switch statement. The purpose of the break is to bring the control out from the said blocks.
Mention the features of C Programming Language.
Following are the features of C Programming Language:
Explain the syntax for for loop.
for(expression-1;expression-2;expression-3) {
//set of statements
}
When control reaches for expression-1 is executed first. Then following expression-2, and if expression-2 evaluates to non-zero ‘set of statements’ and expression-3 is executed, follows expression-2.
What is an infinite loop?
A loop executing repeatedly as the loop-expression always evaluates to true such as
while(0 == 0) {
}
How can we store a negative integer?
To store a negative integer, we need to follow the following steps. Calculate the two’s complement of the same positive integer.
Eg: 1011 (-5)
Step-1: One’s complement of 5: 1010
Step-2: Add 1 to above, giving 1011, which is -5
What is the difference between including the header file with-in angular braces < > and double quotes " "
If a header file is included within < > then the compiler searches for the particular header file only within the built-in include path. If a header file is included within " ", then the compiler searches for the particular header file first in the current working directory, if not found then in the built-in include path.
What is an array in C?
An Array is a group of similar types of elements. It has a contiguous memory location. It makes the code optimized, easy to traverse and easy to sort. The size and type of arrays cannot be changed after their declaration.
Arrays are of two types:
data_type array_name[size];
data_type array_name[size];