Auto AdSense

Monday, 27 October 2014

C Program to Count the Digit 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;
   } 

No comments:

Post a Comment