Program to input marks in 3 subjects and print their average JAVA


Write a Program to input marks in 3 subjects and print their average.




import java.util.*;
class average
{
    public static void main(String args[])
    {
        Scanner sc = new Scanner (System.in);
        int m1 = sc.nextInt();
        int m2 = sc.nextInt();
        int m3 = sc.nextInt();
        int total = m1 + m2 + m3;
        double avg = total / 3;
        System.out.println("Average =" + avg);
    }
}



     
                     

Contact Us

REACH US

SERVICES

  • CODING
  • ON-LINE PREPARATION
  • JAVA & PYTHON

ADDRESS

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 919839520987
Email:info@alexsir.com