GAGBOX is your one source to humor and fun

15 January, 2009

C Program to display the No. of Digits in an Entered Number

This program displayes the number of digits present in the number that is entered through the input.

#include
#include

void main()
{
unsigned long int num;
int i=0;
clrscr();
printf(”Enter the digit\n”);
scanf(”%lu”,&num);
while(num!=0)
{
num=num/10;
++i;
}
printf(”Length=%d”,i);
getch();
}

Share Your Thoughts!

0 comments:

Post a Comment

Copyright © 2013 GagBox™ is a registered trademark.

Designed by GagBox Inc. Desiged By Templateism.com. Blogger Hosting by Blogger.