Computer Science, asked by ansarik8715, 1 year ago

Write a c program to count total number of digits of an integer number (n).]

Answers

Answered by sadakchapp
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