Monday, September 22, 2014

Find Average Using While Loop In Java

Program:


import java.util.Scanner;
public class readerr {
public static void main(String[]args){
Scanner mon=new Scanner(System.in);

double total=0;
double one;
double count = 0;
double average;

while(count<10){
one=mon.nextDouble();
total=total+one;
count++;
}
average=total/10;
System.out.println("the average of the numbers is "+total);

}



Screenshots

Program


Output





where is the wrong keyword written.........find out

No comments: