ENTER STUDENT MARKS AND SEE THE RESULT IN PERCENTAGE IN JAVA
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println( " Enter your math subject number ");
int a = sc.nextInt();
System.out.println( " Enter your chemistry subject number ");
int b = sc.nextInt();
System.out.println( " Enter your physics subject number ");
int c = sc.nextInt();
System.out.println( " Enter your english subject number ");
int d = sc.nextInt();
System.out.println( " Enter your hindi subject number ");
int e = sc.nextInt();
float result = (a+b+c+d+e)/5 ;
System.out.println(" The result is "+ result + "%");
}
}
Comments
Post a Comment