/*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();
}
#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