Hello again guys!
i have a simple question how to promt user to enter a number for example 444 or whatever and for c to print it as a 9 digit number, so if its 444 c would print it as 000000444?
any help would be greatly appriciated.,
thanx!
Hello again guys!
i have a simple question how to promt user to enter a number for example 444 or whatever and for c to print it as a 9 digit number, so if its 444 c would print it as 000000444?
any help would be greatly appriciated.,
thanx!
Jump to Postint n = 444; printf("%09d", n);
More examples here.
Do you want to do it just so you could justify it to the right? If so you could use this:
int i=444;
printf("%9d",i);
It won't include any zeroes at the beginning but it'll be right justified.
Thanx a lot guys!
int i=444;
printf("9%d",i);
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.