Advertisement
pupesko

SoftUni - 5.3 Divide by 7 and 5

Oct 10th, 2015
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. //Write a Boolean expression that checks for given integer if it can be divided (without remainder) by 7 and 5 in the same time.
  2.  
  3. using System;
  4.  
  5. class Divide
  6. {
  7.     static void Main()
  8.     {
  9.         Console.Write("Enter number a = ");
  10.         string numberA = Console.ReadLine();
  11.         int a = int.Parse(numberA);
  12.  
  13.         bool i = ((a % 7 == 0) && (a % 5 == 0) && (a != 0));
  14.         Console.WriteLine(i);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement