Write a program in java to calculate average of five(5) numbers

No comments
import  java.util.*;
class  average
{
public  static  void  main (String obj[  ])
{
     int a, b, c , d, e,tot,avg;
Scanner  sc=new  scanner (system.in);
System.out.println(“Enter  the  value  of  a,b,c,d,e”);
a=sc  nextInt ();
b=sc  nextInt ();
c=sc  nextInt ();
d=sc  nextInt ();
e=sc  nextInt ();
tot=a+b+c+d+e;
avg=tot/5;
system.out.println (“Average of 5 no   is=”+avg);
      }
}

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀