Vision and dreams are the blueprints of soul and achievements.
-Mohammed Ahmed F

Count the number of digits in a number


   #include<stdio.h>
   int main()
   {
     int num,count=0;
     printf("Enter a number: ");
     scanf("%d",&num);
     while(num)
     {
       num=num/10;
       count++;
     }
     printf("Total digits is:%d",count);
     return 0;
   }

Share this

Related Posts

Dear User,

Thank you for your comment. Hope you like this blog. Kindly share us on Social Media so others can be updated.

-Chief Administrative Officer.