60 478
Assignments Done
98,1%
Successfully Done
In April 2018

# Answer to Question #16798 in C# for paul uy

Question #16798
input N integers (ask from the user how many numbers he/she wants to input) determine and print the sum of all numbers, the average of all numbers, how many odd numbers were inputted, how many even numbers were entered and how many zeroes inputted
using System;
using System.Collections.Generic;
using
System.Linq;
using System.Text;

namespace
ConsoleApplication1
{
class Program
{
static void
Main(string[] args)
{
int n = 0;

Console.WriteLine(&quot;Input N: &quot;);
n =
int[] num = new
int[n];
int sum = 0;
int even = 0;

int odd = 0;
int zeroes = 0;
for (int i = 0; i
&lt; n; i++)
{
Console.WriteLine(&quot;Input new
integer: &quot;);
num[i] =
sum = sum +
num[i];
if (num[i] % 2 == 0)

{
even++;
}

else
{
odd++;

}
if (num[i] == 0)

{
zeroes++;
}

}
int ave = sum / n;
Console.WriteLine(&quot;Sum: &quot; +
sum);
Console.WriteLine(&quot;Average: &quot; + ave);

Console.WriteLine(&quot;Odds: &quot; + odd);
Console.WriteLine(&quot;Evens: &quot; +
even);
Console.WriteLine(&quot;Zeroes: &quot; + zeroes);

}
}
}

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!