Control Instructions(C Programming ) Questions and Answers
Explanation:-
Answer: Option A. -> Yes
We can do this in following switchstat ement
switch(a)
{
case 2:
case 3:
case 4:
/* some statements */
break;
case 5:
case 6:
case 7:
/* some statements */
break;
}
Explanation:-
Answer: Option C. -> Error: Lvalue requiredNo answer description available for this question.
Question 9.
Which of the following sentences are correct about a switch loop in a C program?
1:switch is useful when we wish to check the value of variable against a particular set of values.
2:switch is useful when we wish to check whether a value falls in different ranges.
3:Compiler implements a jump table for cases used in switch.
4:It is not necessary to use a break in every switch statement.
Explanation:-
Answer: Option B. -> 1,3,4Explanation:-
Answer: Option A. -> TrueThe basic C compiler is 16 bit compiler, below are the size of it's data types
The size of short int is 2 bytes wide(16 bits).
The size of long int is 4 bytes wide(32 bits).