Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class IntCheckDivisionOf5and7
- {
- static void Main()
- {
- //Write a boolean expression that checks for given integer if it can be divided (without remainder) by 7 and 5 in the same time.
- Console.Write("Enter an integer number:");
- int numberToCheck = int.Parse(Console.ReadLine());
- bool divisionResult = ((numberToCheck % 35) == 0);
- Console.WriteLine("The number {0} {1} be divided by 5 and 7 at the same time.", numberToCheck, divisionResult ? "can" : "cannot");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement