C
Programming and Technical
Programming
Program
#include
void main()
{
int a=100;
printf("%d",a);
printf("%5d",a);
printf("%-5d",a);
}
output???????
Read Solution (Total 9)
-
- 100 100100
For first printf statement it is simply printing the value of a i.e. 100. In second printf statement %5d refers to 5 white spaces to be printed before the integer value. So there are 5 white spaces. In the last printf statement %-5d refers to printing the value from the very left side. - 10 years agoHelpfull: Yes(6) No(0)
- 100 100100
- 10 years agoHelpfull: Yes(1) No(0)
- output:
100
100(after five space 100 will be printed in the case of "%5d")
100 - 9 years agoHelpfull: Yes(1) No(0)
- 100100100
it prints a each time - 10 years agoHelpfull: Yes(0) No(0)
- 100 100100
- 10 years agoHelpfull: Yes(0) No(0)
- 100 100100 _
- 10 years agoHelpfull: Yes(0) No(0)
- 100
100
100 - 10 years agoHelpfull: Yes(0) No(0)
- 100
100
100 - 9 years agoHelpfull: Yes(0) No(0)
- output will be 100 100100
- 9 years agoHelpfull: Yes(0) No(0)
C Other Question