What will be the output of the program?
#include
int main()
{
int x, y, z;
x=y=z=1;
z = ++x || ++y && ++z;
printf("x=%d, y=%d, z=%d\n", x, y, z);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
What is the output of this C code?
int main()
{
int i = 0;
for (foo(); i == 1; i = 2)
printf("In for loop\n");
printf("After loop\n");
}
int foo()
{
return 1;
}
Answer: A
No answer description available for this question
Enter details here
#include
int main()
{
int i = 3;
switch (i)
{
case 0+1: printf("Geeks");
break;
case 1+2: printf("Quiz");
break;
default: printf("GeeksQuiz");
}
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
A typical “switch” body looks as follows:
switch (controlling_expression)
{
case label1:
/*label1 statements*/
break;
case label2:
/*label1 statements*/
break;
default:
/*Default statements*/
}
Answer: C
No answer description available for this question.
Enter details here
What is the output of this C code?
void main()
{
int i = 0;
int j = 0;
for (i = 0;i < 5 xss=removed> 1)
continue;
printf("Hi \n");
}
}
}
Answer: B
No answer description available for this question.
Enter details here
Consider the following program fragment
if(a > b)
if(b > c)
s1;
else s2;
s2 will be executed if
Answer: D
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
int main()
{
float a = 0.7;
if(0.7 > a)
printf("Hi\n");
else
printf("Hello\n");
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
Which of the following is not logical operator?
Answer: A
No answer description available for this question.
Enter details here
Which of the following sentences are correct about a for loop in a C program?
1. for loop works faster than a while loop.
2. All things that can be done using a for loop can also be done using a while loop
3. for(;;); implements an infinite loop.
4. for loop can be used if we want statements in a loop get executed at least once.
Answer: D
No answer description available for this question.
Enter details here
What is the output of this C code?
void main()
{
int i = 0, j = 0;
for (i = 0;i < 5 xss=removed> 1)
break;
}
printf("Hi \n");
}
}
Answer: A
No answer description available for this question.
Enter details here