Write a c program to count total number of digits of an integer number (n).]
Answers
Answered by
2
Answer: I think it will help you!
thank you.
Explanation:
#include <stdio.h>
int main()
{
long long n;
int count = 0;
printf("Enter an integer: ");
scanf("%lld", &n)
while (n != 0)
{
n /= 10; // n = n/10
++count;
}
printf("Number of digits: %d", count);
}
Similar questions
Social Sciences,
6 months ago
English,
6 months ago
Environmental Sciences,
6 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
India Languages,
1 year ago