indra_jit_r

problem_4

Oct 27th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4.  
  5. {
  6.     int x;
  7.     printf("Enter an integer: ");
  8.     scanf("%d", &x);
  9.     if(x % 5 == 0 && x % 11 == 0) printf("%d is a multiple of both 5 and 11\n", x);
  10.     else if(x % 5 == 0) printf("%d is a multiple of only 5\n", x);
  11.     else if(x % 11 == 0) printf("%d is a multiple of only 11\n", x);
  12.     else printf("%d is neither a multiple of 5 nor 11\n", x);
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment