import java.util.Scanner;
public class HackDefence{
public static void main(String[]args){
Scanner input = new Scanner(System.in);
int total =0;
int marks;
int average;
int counter=0;
while(counter<4){
marks=input.nextInt();
total= total + marks;
counter++;
}average=total/4;
System.out.println("AVERAGE=" + average);
}
}
OUTPUT:
public class HackDefence{
public static void main(String[]args){
Scanner input = new Scanner(System.in);
int total =0;
int marks;
int average;
int counter=0;
while(counter<4){
marks=input.nextInt();
total= total + marks;
counter++;
}average=total/4;
System.out.println("AVERAGE=" + average);
}
}
OUTPUT:
No comments:
Post a Comment