147k views
3 votes
Write an application that reads three integers, adds all three together, computes an average of the three entries, and computes any remainder of the integer division. A remainder represents the modulus result of dividing an even by an odd number or vice versa. Display the output.

User Ilhicas
by
6.8k points

1 Answer

0 votes

Answer:

//The program prompts user to input three integers and it displays them, adds and gets their average

//begin

public class Test

{

public static void Main()

{

//input intergers

int[] score = new int[3];

int avg,rem,sum = 0;

for(int i=0;i<3;i++)

{

Console.WriteLine("Enter an integer score ");

score[i] = Convert.ToInt32(Console.ReadLine());

sum = sum + score[i];

}

avg = sum/3;

rem = sum%3;

Console.WriteLine("The average of "+score[0]+","+score[1]+","+score[2]+" is "+avg +" with a remainder of "+rem);

}

}

User Samantha Adrichem
by
5.6k points