C Language - Input/Output

C Language - Input/Output
41.  main ( )
{
double x = 1/2. 0 - 1/2;
printf('x=%.2f\n',x);
}
What will be printed when the above code is executed ?
  • x=0.00
  • x=0.25
  • x=0.50
  • x=1.00
Show Answer
42.  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 ?
  • z = 0.00
  • z = 0.50
  • z = 1.00
  • 2.00
Show Answer
43.  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)
}
  • z = 0.00
  • z = 1.00
  • z = 1.50
  • z = 2.00
Show Answer
44.  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 ?
  • x = 2 y = 2z = 2
  • x = 1 y = 2 z = 2
  • x = 2 x = 2 y = 0
  • x 2 y = 2 z = 1
Show Answer
45.  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 ?
  • 0, 0, 0
  • -1, -1, -2
  • -1, 0, 1
  • none
Show Answer
46. # include  <stdio.h>
main ()
{
int a = 0xfff;
(a << 4 >> 12) ? printf ("Sandeep "): printf ("Ashok");
}
What will be the output of the program ?                                 
  • Ashok
  • Sandeep
  • Error: Incorrect Assignment
  • None
Show Answer
47.  printf ("daily click !");
in the code segment above, the words Daily click ! will be printed to what output device ?
  • to an E-mail message
  • to the console
  • to the default printer
  • to wherever standard output has been directed to
Show Answer
48.  If x -= 2, y = 6, and z = 6 then, what will be the output of 
x = y = = z;
printf (%d", x) ;
  • 0
  • 1
  • 2
  • 6
Show Answer
49.  int i = 20;
printf ( "%x", i);
What is the output?
  • x 14
  • 14
  • 20
  • none of the above
Show Answer
50.  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?
  • 4.20, 3.00
  • 4.2, 2.3
  • 4.20, 2.30
  • 4.20 3.20
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test