Sudeep Kumar Das

Enter 3 numbers from the user & make a function to print their average.

Java Basic Codes

Explanation

1274    0

import java.util.*;

public class Solutions {

   public static void main(String args[]) {

      Scanner sc = new Scanner(System.in);

      int a = sc.nextInt();

      int b = sc.nextInt();

      int c = sc.nextInt();

 

      int average = (a + b + c) / 3;

      System.out.println(average);

   }   

}



Share:   

More Questions from Java Basic Codes Module 0