Nayeemzaman

Lucky Division

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