Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Wednesday, February 10, 2010

Output of an integer number

Following is the format for an integer output namely %wd where 'w' specify the minimum field width necessary to print the integer value.

if w > 0 then the printing is right justified
if w < 0 then the printing is left justified

For eg:- Let a = 3248





















Statement
Output
printf("%d",a);
3248
printf("%7d",a);
_ _ _3248
printf("%10d",a);
_ _ _ _ _ _3248
printf("% - 6d",a);
3248_ _
printf("% - 9d",a);
3248_ _ _ _ _
printf("% - 15d",a);
3248_ _ _ _ _ _ _ _ _ _ _

Related Posts by Categories



0 comments:

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP