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();
}
#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();
}
I love learning and I love people and you’re a person and you’re here to learn. Hopefully, you can see where I’m going with this.
0 Comments
Have any query? Want any type of module?
Please comment it down and let me know.