//*******************************************************************************************************************************************************
// Program Name: Lab 4.2 *
// Author: Muhammad Patel *
// Date: 11/12/2021 *
// Description: Lab 4 Excercise Question 2 : Determinig whether a number is even or odd *
using System;// Allows to specify multiple resources in one statement.
// Provides a context for the named things in the application for namespace on visual studio
public class Program // Combines fields/ methods into a single unit
{
public static void Main() //The first method that gets invoked in a file.
int User_Integer; // The variables are declared
Console.WriteLine("\nEnter any integer"); // This prints out to the screen the instruction for the user
User_Integer = Convert.ToInt32(Console.ReadLine()); // This assigns the user input converted to an integer to the declared variable.
if (User_Integer % 2 == 0) // this provides a condition for the program to work against. checks whether the modulus of the num to 2 is equal to zero
Console.WriteLine("The integer is even"); // if the condition is met by the user input then the console will write this line out
}
else // This provides a fall back for the program that if it doesnt meet any conditions then it will always output the statement in its curly braces.
Console.WriteLine("The integer is odd"); // This is printed if nothing is met.