please help me with this problem
C / C++ / MFC
2
Posts
2
Posters
1
Views
1
Watching
-
print these numbers 6 28 66 in form of pyramid like 00006 00028 00066
-
print these numbers 6 28 66 in form of pyramid like 00006 00028 00066
It's called string formatting and you want leading zeros Here is the full reference printf - C++ Reference[^] Look at the sample with leading zeros ... which will be in your case you want 6 digits
printf ("Preceding with zeros: %06d \n", 6);
printf("Preceding with zeros: %06d \n", 28);
printf("Preceding with zeros: %06d \n", 66);In vino veritas