Computer Science, asked by poorv29, 1 year ago

write a program to average five numbers​

Answers

Answered by arjunbadola70
1

Explanation:

import java.util.Scanner;

public class Average {

public static void main(String[] args)

{

int i,n=0,s=0;

double avg;

{

System.out.println("Input the 5 numbers : ");

}

for (i=0;i<5;i++)

{

Scanner in = new Scanner(System.in);

n = in.nextInt();

s +=n;

}

avg=s/5;

System.out.println("The Average is : " +avg);

}

}

Similar questions