C# Program:Accepet 3 Numbers Display Their Sum And Average. This Process Needs To Be Repeated 15 Times

Sunday 12 February 2012

using System;
class Prod
{
public static void Main()
{
int n1,n2,n3,sum,avg,cnt;
cnt=1;
while(cnt<=15)
{
Console.WriteLine("{0}.Enter 3 Numbers:",cnt);
n1=Convert.ToInt32(Console.ReadLine());
n2=Convert.ToInt32(Console.ReadLine());
n3=Convert.ToInt32(Console.ReadLine());
sum=n1+n2+n3;
avg=sum/3;
cnt++;
Console.WriteLine("Sum Of Three No:"+sum);
Console.WriteLine("Avg Of Three No:"+avg);
}
}
}
OUTPUT:-