+ 3
What is meaning of "%4d" ,"%7.2f". In printf function.
why it's required.
2 Answers
+ 5
%4d means 4 spaces and then after print and same %7.2f, but .2 indicate after point only show two values.
e.g.
https://code.sololearn.com/cb04LL34Q0HG/?ref=app
e.g
#include <stdio.h>
int main() {
int a,b,c;
printf("%4d\n",10);
printf("%11.2f",11.2345);
return 0;
}
0
no