Advertisement
Vladimir76

Задача 2

Dec 27th, 2013
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. Console.Write("Enter a value for x:");
  2. long x = long.Parse(Console.ReadLine());
  3. long y = 5;
  4. long z = 7;
  5.  
  6. bool xy = (x % y) == 0;
  7. bool xz = (x % z) == 0;
  8. if (xy && xz)
  9. {
  10. Console.WriteLine("number is divisible by 5 and 7");
  11. }
  12. else
  13. {
  14. Console.WriteLine("the number is not divisible by 5 и 7");
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement