+ 2
We mostly using this when we dealing with floating values . If we want to print digits upto which we want. Here %2.4 2 won't effect your program u can also write %.4 instead of 2.4 it will print number upto four digits here u used single digit number so 3 zero will added automatically printf("%2.4d",a);
4th Jul 2021, 5:05 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 2
Yeah same try with float u will understood better
5th Jul 2021, 3:51 AM
A S Raghuvanshi
A S Raghuvanshi - avatar