Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Leading Zeros

Status
Not open for further replies.

Spannerman

Programmer
Dec 31, 2000
26
0
0
GB
I am trying to print leading zeros.My number is a numeric clock card number that is usually 4 digits.If ,however,the number should be less than 1000 I want to print leading zeros so that my columns on my print out remain level.
Anyone help???
 
int i = 32;

printf("%04d", i);

this will print - 0032 Hoping to get certified..in C programming.
 
Thanks.This was a great help and very simple since I had been messing with itoa,strcpy and strcat with no success.
Nice One!!!!!
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top