coasterka

#3DivideBy7And5

Mar 13th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. static void Main()
  2.         {
  3.             Console.WriteLine("Enter a random whole number to check if it's divisible by 5 and 7.");
  4.             int number = int.Parse(Console.ReadLine());
  5.             bool isDivisible = number % 5 == 0 && number % 7 == 0;
  6.             Console.WriteLine("The number {0} is divisible by 5 and 7: {1}", number, isDivisible);            
  7.         }
Advertisement
Add Comment
Please, Sign In to add comment