Question: Can you change this code so that it tells whether a number is divisible by 2, 3, or 2 and 3? static void Main(string[] args)
Can you change this code so that it tells whether a number is divisible by 2, 3, or 2 and 3?
static void Main(string[] args) { WriteLine("Enter an integer:"); int myInt = ToInt32(ReadLine()); bool isLessThan10 = myInt < 10; bool isBetween0And5 = (0 <= myInt) && (myInt <= 5); WriteLine($"Integer less than 10? {isLessThan10}"); WriteLine($"Integer between 0 and 5? {isBetween0And5}"); WriteLine($"Exactly one of the above is true? " + $"{isLessThan10 ^ isBetween0And5}"); ReadKey(); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
