C Language - Input/Output

C Language - Input/Output
31.  What is the purpose of the flag + used in printf () function ?
  • Centered
  • Right justified
  • Putting sign
  • Left justified
Show Answer
32.  What is the purpose of the flag + used in printf() function ?
  • Left justified
  • + or - precedes the signednumbers
  • Right justified
  • Centered
Show Answer
33.  What is the purpose of the flag # used in printf () function ?
  • Left justified
  • Right justified
  • 0 and 0x precede non-zero octal and hexa values respectively
  • Leading zeros appear
Show Answer
34.  What is the purpose of the flag 0 used in the function printf()?
  • Leading blanks are displayed
  • Leading zero appears
  • - sign precedes
  • + or - sign precedes
Show Answer
35.  What is the purpose of the flag blank used in the function printf () ?
  • - precedes negative value and blank precedes positive value.
  • - precedes negative value and + precedes positive value.
  • - sign precedes negative value and nothing precedes positive value.
  • Blank precedes negative and positive numbers.
Show Answer
36.  What is the output of the following code ?
main ()
{
printf ("%c", 'a');
}

  • 65
  • a
  • A
  • Error
Show Answer
37.  What is theoutput of the following code ?
main ()
{
printf("%d", ' A ');}
  • 65
  • a
  • A
  • Error
Show Answer
38. What is the output of the following code ?
main ()
{
Char name {};
strcpy (name, "poorani");
printf("%C%c%c", name [4], name [5], name [6]);
}
  • rani
  • ran
  • ani
  • orani
Show Answer
39. What format is used to print a character with the printf function ?
  • %s
  • %c
  • %char
  • %Ic
Show Answer
40.  "The stock's value increased by 15%." select the statement, which will exactly reproduce the line of text above. 
  • Printf ("\" The stock \'s value increased by %d%%.\"\n",15);
  • printf(" The stock\'s value increased by %d%.\n",15);
  • printf("\"The stock\'s value increased by %d%%.\"\n",15);
  • printf('\"The stock\'s value increased by %d%.\"\n");
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test