D
Deleted member 613
Guest
C#:
using System;
class MainClass {
public static void Main (string[] args) {
int i;
Console.Write("Enter a Number : ");
i = int.Parse(Console.ReadLine());
if (i % 2 == 0)
{
Console.Write("Your number is an Even Number :)");
Console.Read();
}
else
{
Console.Write("Your number is an Odd Number :0");
}
}
}
The console reads whichever number the user inputs and stores it in a variable(i). Then the computer does a check on the number(its to hard to explain exactly how) and then outputs a message corresponding to the result of the check.
Last edited by a moderator: