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
32. What is the purpose of the flag + used in printf() function ?
- Left justified
- + or - precedes the signednumbers
- Right justified
- Centered
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
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
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.
36. What is the output of the following code ?
main ()
{
printf ("%c", 'a');
}
main ()
{
printf ("%c", 'a');
}
- 65
- a
- A
- Error
37. What is theoutput of the following code ?
main ()
{
printf("%d", ' A ');}
main ()
{
printf("%d", ' A ');}
- 65
- a
- A
- Error
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]);
}
main ()
{
Char name {};
strcpy (name, "poorani");
printf("%C%c%c", name [4], name [5], name [6]);
}
- rani
- ran
- ani
- orani
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");