What will be the output of the program?
#include<stdio.h>
int main()
{
int a =b, c;
if(a >=
b =
c =
printf("%d, %d, %d\n", a, b, c);
return
}
What will be the output of the program?
#include<stdio.h>
int main()
{
char ch;
if(ch = printf(""))
printf("It matters\n");
else
printf("It doesn't matters\n");
return}
Which of the following statements are correct about an if-else statements in a C-program?
| 1: | Every if-else statement can be replaced by an equivalent statements using ?: operators |
| 2: | Nested if-else statements are allowed. |
| 3: | Multiple statements in an if block are allowed. |
| 4: | Multiple statements in an else block are allowed. |
A char variable can store either an ASCII character or a Unicode character.
Point out the error, if any in the while loop.
#include<stdio.h>
int main()
{
void fun();
int i = while(i <= {
printf("%d\n", i);
if(i> goto here;
}
return}
void fun()
{
here:
printf("It works");
}
Which of the following errors would be reported by the compiler on compiling the program given below?
#include<stdio.h>
int main()
{
int a =
switch(a)
{
case
printf("First");
case
printf("Second");
case 3 +
printf("Third");
case
printf("Final");
break;
}
return
}
What will be the output of the program?
#include<stdio.h>
int main()
{
int i = switch(i)
{
printf("Hello\n");
case printf("Hi\n");
break;
case printf("\nBye\n");
break;
}
return}
What will be the output of the program?
#include<stdio.h>
int main()
{
int x=y=
for(; y; printf("%d %d\n", x, y))
{
y = x++ <=
}
printf("\n");
return
}
What will be the output of the program?
#include<stdio.h>
int main()
{
unsigned int i =/* Assume 2 byte integer*/
while(i != printf("%d",++i);
printf("\n");
return}
Which of the following statements are correct about the below program?
#include<stdio.h>
int main()
{
int i = i++;
if(i <= {
printf("IndiaBIX\n");
exit(0);
main();
}
return}
Point out the error, if any in the program.
#include<stdio.h>
int main()
{
int a =b;
a >=5 ? b=b= printf("%d\n", b);
return}
What will be the output of the program?
#include<stdio.h>
int main()
{
char j=
while(j <
{
printf("%d, ", j);
j = j+
}
printf("\n");
return
}
What will be the output of the program?
#include<stdio.h>
int main()
{
int i =
while(i-- >=
printf("%d,", i);
i =
printf("\n");
while(i-- >=
printf("%i,", i);
while(i-- >=
printf("%d,", i);
return
}
What will be the output of the program?
#include<stdio.h>
int main()
{
float a = 0.
if(0.7 > a)
printf("Hi\n");
else
printf("Hello\n");
return
}
What will be the output of the program?
#include<stdio.h>
int main()
{
int x, y, z;
x=y=z= z = ++x || ++y && ++z;
printf("x=%d, y=%d, z=%d\n", x, y, z);
return}
What will be the output of the program?
#include<stdio.h>
int main()
{
int i=
switch(i)
{
case
printf("Hello\n");
case
printf("Hi\n");
case
continue;
default:
printf("Bye\n");
}
return
}
What will be the output of the program?
#include<stdio.h>
int main()
{
int a=b=c=
*((a) ? &b : &a) = a ? b : c;
printf("%d, %d, %d\n", a, b, c);
return
}
How many times "IndiaBIX" is get printed?
#include<stdio.h>
int main()
{
int x;
for(x=-x<=x++)
{
if(x < continue;
else
break;
printf("IndiaBIX");
}
return}
Which of the following statements are correct about the below C-program?
#include<stdio.h>
int main()
{
int x =y = 100%i;
for(i=i<i++)
if(x != y);
printf("x = %d y = %d\n", x, y);
return}
| 1 : | The printf() function is calledtimes. |
| 2 : | The program will produce the output x =y = 10 |
| 3 : | The ; after the if(x!=y) will NOT produce an error. |
| 4 : | The program will not produce output. |
What will be the output of the program?
#include<stdio.h>
int main()
{
int i= for(; i<=i++);
printf("%d", i);
return}