Write a output for the following c program
#include< mani( ) { int x = 789; float y = 6767.8787; printf("% -8d %+9.3f\n", x, y); printf("%+-6d % -15.2f\n", x, y); } |
---|
Output:-
789 _ _ _ _ _+6767.879
+789 _ _ 6767.88 _ _ _ _ _ _ _ _
#include< mani( ) { int x = 789; float y = 6767.8787; printf("% -8d %+9.3f\n", x, y); printf("%+-6d % -15.2f\n", x, y); } |
---|
#include< mani( ) { char x = '&'; float y = 2134.627; printf("%3c %9.2f\n", x, y); printf("% -4c -7.0f\n", x, y); return(0); } |
---|
mani( ) { int a = 1235, b = -1888; float x = 2233.44, y = 4455.66; printf("% -6d % -6d\n", a, b); printf("% -8.2f % -10.1f\n", x, y); } |
---|
mani( ) { int a = 1235, b = -1888; float x = 2233.44, y = 4455.66; printf("%6d %6d\n", a, b); printf("%+8.2f %+10.1f\n", x, y); } |
---|
Statement | Output |
---|---|
printf("%15s",name); | SEETA_AUR_GEETA |
printf("%10.6s",name); | _ _ _ _SEETA_ |
printf("%9.3s",name); | _ _ _ _ _ _SEE |
printf("% - 10.7s",name); | SEETA_A_ _ _ |
printf("% - 12.9s",name); | SEETA_AUR_ _ _ |
Statement | Output |
---|---|
printf("%4c",a); | _ _ _ Q |
printf("%8c",a); | _ _ _ _ _ _ _ Q |
printf("%5c",a); | _ _ _ _ Q |
printf("% - 7c",a); | Q _ _ _ _ _ _ |
printf("% - 4c",a); | Q_ _ _ |
printf("% 12c",a); | _ _ _ _ _ _ _ _ _ _ _ Q |
Statement | Output |
---|---|
printf("%f",a); | 32.289 |
printf("%8.3f",a); | _ _32.289 |
printf("%10.2f",a); | _ _ _ _ _32.29 |
printf("% - 7.3f",a); | 32.289_ |
printf("% - 11.3f",a); | 32.289_ _ _ _ _ |
printf("% 11.4f",a); | _ _ _ _32.2890 |
© Blogger templates Newspaper III by Ourblogtemplates.com 2008
Back to TOP