What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input)
#include < stdio.h >
void main()
{
double ch;
printf(“enter a value between 1 to 2:”);
scanf(“%lf”, &ch);
switch (ch)
{
case 1:
printf(“1”);
break;
case 2:
printf(“2”);
break;
}
}
a) Compile time error
b) 1
c) 2
d) Varies
Answer: a
Related Posts
The condition flag Z is set to 1 to indicate _______
When using Branching, the usual sequencing of the PC is altered. A new instruction is loaded which is called as ______
While using the iterative construct (Branching) in execution _____________ instruction is used to check the condition
The Instruction fetch phase ends with _________
The two phases of executing an instruction are __________
In a system, which has 32 registers the register id is __________ long.
The instruction, Add R1,R2,R3 in RTN is _______
Join The Discussion