Thursday, 28 July 2011

A simple program to find the average of 10 nos. using array class Arg



class Arg
{
Public static void main (string arg [])
{
int no []= { 10 ,12 , 14 ,16 ,18 ,20 ,22, 24 ,26 28);
int result = 0;
for (i=0; i<10;i++)
result =result + no [i];
System.out.println(“Average is “ +result/10);
}
}

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More