Saturday, 18 July 2015

PROGRAMME TO TAKE THREE SUBJECTS INPUT MARKS AND DISPLAY TOTAL,PERCENTAGE AND DIVISION OF STUDENT.

programme:-write it in notepad.


import java.util.*;
public class marks
{
public static void main(String args[])
{
int phy,chem,math,total,perc,div;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the marks of phy and chem and math");
phy=sc.nextInt();
chem=sc.nextInt();
math=sc.nextInt();
total=(phy+chem+math);
perc=(total/3);
{
System.out.println("Total" +(total));
System.out.println("perc" +(perc));
}
if(perc>=65)
{
System.out.println("Student is first divison");
}
else
{
System.out.println("second division");
}
}
}


save it by marks.java in notepad
1) javac marks.java
2) java marks




No comments:

Post a Comment