Advertisement
Kawsar_Hossain

Problem-10

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