Sum And Percentage Of 5 Subjects In Java
This Java program finds the Total, Average, and Percentage of those Five Subjects. In this example, we are using the Arithmetic Operators to perform arithmetic operations
.
.
package ex1;
public class avg1 {
public static void main(String[] args) {
float s1,s2,s3,s4,s5,sum,per;
sum = s1+s2+s3+s4+s5;
per = (sum/5);
System.out.print("\n sum " +sum + "\t percentage are\t" +per);
}
}
No comments:
Post a Comment