WAP to input the name of a student and his/her marks in 3 subjects. Display the total marks and average marks. (Java).
Answers
Answered by
4
Answer:
import java. util.*;
public class x
{
public static void main(string args [ ])
{
scanner in=new scanner( );
sopln ("enter name and marks");
string nm = in.nextline( );
int s1=in.nextint( );
int s2=in.nextint();
int s3=in.nextint ();
int to=s1+s2+s3;
double avg=to/3;
sopln("total marks "+to);
sopln("average"+avg);
}
}
Similar questions