google-site-verification: googlef8aa845b858144d3.html COMPUTER SCIENCE NOTES: COUNT DIGIT OF ANY NUMBER

Monday, July 17, 2017

COUNT DIGIT OF ANY NUMBER

/*count the digit of any number */
#include<stdio.h>
#include<conio.h>
void main()
{
int num,count=0;
clrscr();
printf("Enter number :");
scanf("%d",&num);
do{
num/=10;
count++;
}while(num>0);

printf("digit =%d",count);
getch();
}

No comments:

Post a Comment