C interview questions
What you will learn here, C interview questions:
- C interview questions
1)Why c is platform dependent?
Please visit the following link to know why c is platform dependent in detail.
2)Can we use reserved keywords as identifier i.e variable name or function name?
3)Can we use a variable before the declaration?
4)What are the storage classes in c?
C has 4 storage classes and those are
- Automatic storage class
- Register storage class
- Static storage class
- External storage class
5)What is default storage class in c?
6)Can we call main function in main function?
7)Can we call main function from another function in c?
8)Can we declare two variables with the same name?
9)What is the difference between i++ and++i in c?
i++ is the post increment means it assigns the value and then increments the value of i by 1 where ++i is the pre increment means it increments the value of i by 1 and then assigns the value.
Example:
int i=0;
i++; // here i is 0
++i; // here i is 2
10) What is difference between parameter and argument?
Variables that we declare inside the parenthesis of the function definition is called a parameter where the argument is the actual values which we pass at the time of function call.
Example:
void test( int a, int b){} // where a and b are parameters
test(10,20); // where 10 and 20 are the arguments;
11)What is call by value and call by reference in c?
12)What is the difference between break and continue
13)What is the difference between = and == in c?
14)What is binary operator in c?
logical AND (&&) and logical OR (||) are the binary operators in C because logical AND (&&) and logical OR (||) operates on two operands or data.
Example:
5>2 && 3>1 // where (5>2) is one operand and (3>1) is another operand
5>10 || 3>1 // where (5>10) is one operand and (3>1) is another operand
15)what is unary operator in c
Not(!) is the unary operator in C because it operates on a single operand or data.
Example:
(!5) // requires only one data