ellapt

3.2.Divisible5and7

Dec 14th, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. class Divisible5and7
  4. {
  5. static void Main()
  6. {
  7. Console.WriteLine("Please, enter an integer number: ");
  8. string inputInt = Console.ReadLine();
  9. int modOf5and7;
  10. if (int.TryParse(inputInt, out modOf5and7))
  11. {
  12. if ((modOf5and7 % 5 == 0)&&(modOf5and7 % 7 == 0))
  13. {
  14. Console.WriteLine("The number {0} IS divisible by 5 and 7 without resudue.", modOf5and7);
  15. }
  16. else
  17. {
  18. Console.WriteLine("The number {0} IS NOT divisible by 5 and 7 without resudue.", modOf5and7);
  19. }
  20. }
  21. else
  22. {
  23. Console.WriteLine("{0} is not an integer number!", inputInt);
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment