Description Programming 1 Exercise 4 No. Topic 1. Basic input/output function 2. variable declaration 3. Arithmetic operators Intended 1. develop a simple c# program Learning 2. use variables in a program Outcome 3. apply arithmetic operators in the program
Instruction: Output:
1. Make a C# program that will Input any number: 1
allow the user to input an integer Odd and then display wether it is odd or Input any number: 2 even. Even
REPORT (use separate sheet if necessary)
Source Code: Output: using System Input any number: 1 namespace Console Application1 { Odd class Program Input any { number: 2 Static void Main(string[]args) Even { int y;
Console.WriteLine(“Input any number:”);
y = int.Parse(Console.ReadLine()); if (y % 2 == 0) { Console.WriteLine(“Even”); } else Console.WriteLine(“Odd”); } Console.ReadLine();