Advertisement
mustahidhasan

count the input digit

Feb 24th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.  
  5.  
  6.     int num;
  7.     int  count = 0;
  8.     scanf("%d", &num);
  9.  
  10.     while(num != 0)
  11.     {
  12.         num /= 10;
  13.         count++;
  14.     }
  15.     printf("%d", count);
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement