PRINTING IN JAVA
In this program we will print the marks of a student and at last we will print his total and percentage.
Let's consider a student Raja. if you had not yet followed me at instagram then go to my id and follow me to get more intresting topic.
Raja , a student of class 10 and his marks are below print them in java.
So, here is your program.
class marks
{
public static void main(String args[])
{
int // int and variables are in one line math=78,comp=90,phy=76,chem=67,bio=89,hist=45,hindi=66,Geography=66,English=55,total;
float percent;
System.out.println("math :"+math);
System.out.println("comp : "+comp);
System.out.println("phy : "+phy);
System.out.println("chem : "+chem);
System.out.println("bio : "+bio);
System.out.println("hist : "+hist);
System.out.println("hindi : "+hindi);
System.out.println("Geography : "+Geography);
System.out.println("English : "+English);
total=math+phy+chem+bio+comp+hist;
percent=total/100*9;
System.out.println("the total mark of the student : "+total);
System.out.println("the total percent of the student : "+percent);
}
}
0 Comments