What does this %1d means | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What does this %1d means

14th Jul 2020, 2:32 PM
Mimansa Sharma
Mimansa Sharma - avatar
2 Answers
+ 4
Tag language also... %1d is same as %d. No make difference. But Ex: %3d here 3 number says the reserve space for atleast 3 digits in output.. So it displayed like 100 9 Otherwise is it like 100 9 So there space is added, To understand better Run this code printf("%5d", n) ; If n=9,then it deplays 00009 (0 is appended, note to make it atleast 5 digits..) you can add anything like this.. If n= 99999, it displays same.. No appends.. %1d, since atleast int is 1 digit always.. No effect..
14th Jul 2020, 2:48 PM
Jayakrishna 🇮🇳
0
%ld means long integer
14th Jul 2020, 3:29 PM
Kriti Pashine
Kriti Pashine - avatar