Advertisement
kuruku

DivideNumbereByFiveAndSeven

Apr 16th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. using System;
  2.  
  3. //Write a Boolean expression that checks whether a given integer is
  4. //divisible by both 5 and 7, without a remainder.
  5.  
  6. class DivideNumbereByFiveAndSeven
  7. {
  8.     static void Main()
  9.     {
  10.         bool isTrue = false;
  11.         int n = int.Parse(Console.ReadLine());
  12.  
  13.         if (n%5 == 0 && n%7 == 0)
  14.         {
  15.             isTrue = true;
  16.         }
  17.  
  18.         Console.WriteLine(isTrue);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement