#include<stdio.h>intmain()
{
long long n;
int count = 0;
printf("Enter an integer: ");
scanf("%lld", &n);
while(n != 0)
{
// n = n/10
n /= 10;
++count;
}
printf("Number of digits: %d", count);
}
Program to Count Number of Digits in an Integer
Reviewed by Unknown
on
01:59
Rating: 5
No comments: