0

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!

4
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by yuvaraj.tr
0

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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.