Advertisement
yoyo106

Number of 7

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