What are the codes in c# programming that will have a sample output like this;
Enter a number:2
Enter a number:3
Enter a number:4
Enter a number:5
Sum of even number:6
Sum of add nunber:8
Do you want more?(Y/N):n
using System;
public class Exercise4
{
public static void Main()
{
for (int i = 0; i < 4; i++) {
int e = 0, o = 0, n = Parse.Int32(Console.ReadLine());
if (n%2==0) e+=n;
else o += n;
Console.WriteLine(e);
Console.WriteLine(o);
}
}
}
Comments
Leave a comment