-
Declare two variables (n and result).
-
Read the user input from the console. (int.Parse(Console.ReadLine());).
-
Check if the input number is divided by 9, 11 or 13 using the logical operators:
-
Use: (n % 9 == 0) || (n % 11 == 0) || (n % 13 == 0);
-
|| checks if the left expression OR the right expression have a true value. If only one has a true value the result is true;
-
Save the result of the verification in the result variable;
-
Print the result on the console (Console.WriteLine(result));)
using System;
class PureDivisor
{
static void Main()
{
Console.WriteLine("Please write your number so the program can check \nwhether it can be devided by 9, 11 and 13.");
int n = int.Parse(Console.ReadLine());
bool result = (n % 9 == 0) || (n % 11 == 0) || (n % 13 == 0);
Console.WriteLine("The answer is: {0}", result);
}
}