C Programming MCQ - Variables & Datatypes
14. Which of the following can have different meaning in different contexts?
Explanation: & have different meaning in different contexts.
15. Which of the following is not a valid declaration in C?
1. short int x;
2. signed short x;
3. short x;
4. unsigned short x;
Explanation: All are valid. First 3 mean the same thing. 4th means unsigned.
16.The minimum number of temporary variable needed to swap the content two variables is?
Explanation: Without any temporary variable ,one can swap two variables easily.
For Example :- var a ,b;
17.What is short int in C programming?
Explanation:short is the qualifier and int is the basic datatype.
18. The precedence of arithmetic operators is (from highest to lowest)?
Explanation:All arithmetic operators in C language follow the left to right associativity. Their precedence from highest to lowest is as given below:
() => Brackets
% => Modulus
* => Multiplication
/ => Division
+ => Addition
- => Subtraction
In an arithmetic operation, the higher precedence operators are evaluated first followed by the lower value operators.
19. Which of the following data type will throw an error on modulus operation(%)?
Explanation: Float data type will throw an error on modulus operation(%).
20.Relational operators cannot be used on:
Explanation: structure cannot be used on Relational operators.
Also check :