C Language - Input/Output Questions and Answers
Practice ModeShowing 10 of 54 questions
Q41
main ( )
{
double x = 1/2. 0 - 1/2;
printf('x=%.2f\n',x);
}
What will be printed when the above code is executed ?
Answer: Option C
Q42
main ( )
{
int x = 5, y = 10;
double z;
z = (double) ( x / y);
printf ("z = %. 2f\n',z)
}
What will be printed when the above code is executed ?
Answer: Option A
Q43
What will be printed when the following code is executed ?
main ( )
{
int i = 4, a = 6;
double z;
z = a /i;
printf ("z = %.2f\n",z)
}
Answer: Option B
Q44
main ( )
{
int x = 3, y = 3, z = 3;
z - = x - - - --y;
printf ("x = %d y = % d z = %d', x, y, z);
}
What will be the value of x, y, and z ?
Answer: Option A
Q45
main ( )
{
int x, y, z ;
printf (" %d \n', ( z > = y>= x ? 10 : 20));
}
What might be the value of x, y, and z, if 20 has to be printed ?
Answer: Option D
Q46
# include <stdio.h>
main ()
{
int a = 0xfff;
(a << 4 >> 12) ? printf ("Sandeep "): printf ("Ashok");
}
What will be the output of the program ?
Answer: Option A
Q47
printf ("daily click !");
in the code segment above, the words Daily click ! will be printed to what output device ?
Answer: Option B
Q48
If x -= 2, y = 6, and z = 6 then, what will be the output of
x = y = = z;
printf (%d", x) ;
Answer: Option B
Q49
int i = 20;
printf ( "%x", i);
What is the output?
Answer: Option B
Q50
float x, y, z;
scanf ("%f%f", &x, &y); printf ("%.2f, %.2f", x,y);
if input stream contains "4.2 3.2 3..." what will be the output?
Answer: Option D