Advertisement
VyaraG

DivideBySevenAndFive

Nov 28th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2.  
  3. //Write a Boolean expression that checks for given integer if it can be divided (without remainder) by 7 and 5 in the same time.
  4.  
  5. class DivideBySevenAndFive
  6. {
  7.     static void Main()
  8.     {
  9.         Console.Write("Enter a number: ");
  10.         int numberToBeChecked = int.Parse(Console.ReadLine());
  11.         bool canBeDivided = true;
  12.         if (numberToBeChecked%5==0 && numberToBeChecked%7==0)
  13.         {
  14.             Console.WriteLine(canBeDivided);
  15.         }
  16.         else
  17.             Console.WriteLine(canBeDivided = false);
  18.    
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement