Point out the error, if any in the for loop.
#include
int main()
{
int i=1;
for(;;)
{
printf("%d\n", i++);
if(i>10)
break;
}
return 0;
}
Answer: D
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
int main()
{
char str[]="C-program";
int a = 5;
printf(a >10?"Ps\n":"%s\n", str);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
We want to test whether a value lies in the range 2 to 4 or 5 to 7. Can we do this using a switch?
Answer: A
No answer description available for this question.
Enter details here
Which of the following errors would be reported by the compiler on compiling the program given below?
#include
int main()
{
int a = 5;
switch(a)
{
case 1:
printf("First");
case 2:
printf("Second");
case 3 + 2:
printf("Third");
case 5:
printf("Final");
break;
}
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
Which keyword can be used for coming out of recursion?
Answer: A
No answer description available for this question.
Enter details here
Which of the following statements are correct about the below program?
#include
int main()
{
int n = 0, y = 1;
y == 1 ? n=0 : n=1;
if(n)
printf("Yes\n");
else
printf("No\n");
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
The continue statment cannot be used with
Answer: D
No answer description available for this question.
Enter details here
The output of the code below is
#include
int x;
void main()
{
if (x)
printf("hi");
else
printf("how are u");
}
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
int main()
{
int a = 500, b = 100, c;
if(!a >= 400)
b = 300;
c = 200;
printf("b = ? = %d\n", b, c);
return 0;
}
Answer: D
No answer description available for this question.
Enter details here
By default, the data type of a constant without a decimal point is int, whereas the one with a decimal point is a double.
Answer: A
No answer description available for this question.
Enter details here