Exp 2

// Exp 2: Write down student information using java


package proj2;

public class studentinfo {

public static void main(String[] args) {
int sub1=60,sub2=70,sub3=80;
System.out.println("NITIN");
System.out.println("Roll NO.:04");
System.out.println("Dept:ENTC");
System.out.println("Marks of sub1:"+sub1);
System.out.println("Marks of sub2:"+sub2);
System.out.println("Marks of sub3:"+sub3);
int total = sub1+sub2+sub3;
System.out.println("Total:"+total);
System.out.println("student got "+sub1+" marks in subject 1");
System.out.println(sub2+"student got in subject2 ");
System.out.println("student got in subject3" +sub3);
int perct=(total*100)/300;
if(perct>60)
{
System.out.println("First class");
}
if(perct<60 && perct>45)
{
System.out.print("second class");
}
}

}



******OUTPUT*******

NITIN
Roll NO.:04
Dept:ENTC
Marks of sub1:60
Marks of sub2:70
Marks of sub3:80
Total:210
student got 60 marks in subject 1
70student got in subject2
student got in subject380
First class

Comments