Saturday, April 2, 2022

Java Program - Data types and variables PART-5

 package selenium;
public class Datatypesandvariable {
   public static void main(String[] args)  {

//Data types and variables
int rollno, tamil, english, maths, science, social, total;
String sname;
float avg;

rollno=1;
sname="suriya";
tamil=65;
english=80;
maths=70;
science=90;
social=85;

total=tamil+english+maths+science+social;
avg=total/5;

System.out.println("Roll Number : " + rollno);
System.out.println("Student Name : " + sname);
System.out.println("Tamil : " + tamil);
System.out.println("English : " + english);
System.out.println("Maths : " + maths);
System.out.println("Science : " + science);
System.out.println("Social : " + social);
System.out.println("Total : " + total);
System.out.println("Average : " + avg);
    }
}

No comments:

Post a Comment