WAP to find and display the average of five numbers in java.
Answers
Answered by
0
Answer:
STEP 1: START
STEP 2: DEFINE n.
STEP 3: SET count = 1
STEP 4: DEFINE xF, averageF
STEP 5: SET sumF = 0
STEP 6: ENTER n
STEP 7: REPEAT STEP 8 to 10 UNTIL count<=n
STEP 8: Enter xF
STEP 9: sumF += xF
SETP 10: count = count + 1
SETP 11: SET averageF = sumF/(n-1)
STEP 12: PRINT averageF
STEP 13: END
Answered by
1
Answer:
Java Program
import static java.lang.Float.sum;
import java.util.Scanner;
public class Average {
public static void main(String[] args)
{
int n, count = 1;
float xF, averageF, sumF = 0;
Scanner sc = new Scanner(System.in);
Similar questions