C Language - Input/Output

C Language - Input/Output
21.  Conversion specification includes 
  • \ and a conversion character
  • / and a conversion character
  • & and a conversion character
  • % and a conversion character
Show Answer
22.  Identify the correct statement given double x; 
  • scanf ("%d", & x);
  • scanf ("%f", x);
  • sfanf ("%d", *x);
  • scanf ("% | f ", & x) ;
Show Answer
23.  Identify the correct statement (s) given float y; 
  • scanf ("%e", & y);
  • scanf ("%i", & y);
  • scanf ("%g", &y);
  • options a and c
Show Answer
24.  For the given scanf () statementt, what is the form of input expected ?
scanf ("%D, %d. %d", &date, &month, &year);
  • 22.4.1972
  • 22 4 1972
  • 22/4/1972
  • options a and b
Show Answer
25.  Identify the wrong statement given, int x; float y; char z;
  • scanf ("%d, %f, %c", &x, &y, &z);
  • scanf ("%d, %f, %c", &x, &y,z);
  • scanf("Rs. %d, %f, %c"< &x, &y, &z);
  • options a and c.
Show Answer
26.  What are the values of x, y and z, if 25 20 30 are given as inputs for scanf("d %*d%d", &x, &y, &z);
  • x = 25,y is not assigned, z = 30
  • x = 25, y = 20, z = 30
  • x = 25, y = 30, z is not assigned
  • x = 25, y is not assigned, z = 20
Show Answer
27.  What are the values of a, b and c, given int a, c' float b; with inputs as 50, 3.52, 20 for the statement scanf("%2d % 2d', &p, &q); ?
  • x = 356 y =47
  • x = 35 y = 6
  • x = 35 y = 4
  • x = 35 y = 47
Show Answer
28.  Char p,q; scanf("%c%Is', &p, &q); what are the values assigned, if x and y are given as inputs ?
  • P = x and q = blank
  • p = x and q is not assigned
  • p = x and q = y
  • p = x and q = x
Show Answer
29.  Identify the correct statement(s) given the declaration char x, y;
  • scanf ("%c%c', &x, &y);
  • scanf ("%c%1s", &x, &y);
  • scanf ("%* [] %c", &x, &y);
  • all the above
Show Answer
30. What is the the value returned by printf () function, if an error occurs ?
  • Positive value
  • 0
  • Negative value
  • 1
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test