Computer Science, asked by rukushrestha099, 11 months ago

Write a program to find the average of three different numbers
Write a program to find the average of three different numbers

Answers

Answered by Ved22541
1

Answer:

import java.util.*;

public class student

{

public static void main(String [] args)

{

int a,b,c,avg;

a=5;

b=7;

c=6;

avg=(a+b+c)/3

System.out.println("The average ="+avg);

}

}

Answered by hoangmustang
2

Answer:

CHECK OUT MY SOLUTION IN JAVA

package newPackage;

import java.util.*;

public class average {

public static void main(String[] args) {

 

Scanner input = new Scanner(System.in);

int a = input.nextInt();//input number a

int b = input.nextInt();//input number b

int c = input.nextInt();//input number c

System.out.println((a + b + c)/3);//calculate average

}

}

Explanation:

Do you see the crown symbol at the left bottom? CLICK IT!

Similar questions