Answer to Question #284115 in C++ for Jen

Question #284115

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


1
Expert's answer
2022-01-02T02:21:04-0500
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);
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog