Ad Code

Write a program to count the number of digits of a given number.

 Program to count the number of digits of a given number.



#include<stdio.h>
#include<conio.h>
void main()
{
int n,c=0;
clrscr();
printf(“enter the first number”);
scanf(“%d”,&n);
while(n!=0)
{
c++;
n =n/10;
}
printf(“%d”,c);
getch();
}

Post a Comment

0 Comments

Ad Code