Computer Science, asked by namanksavla, 10 months ago

Write a java program to input your name, roll no, class, house, marks in 3 subjects, find the total, average and print your name, roll no and average. Sample Input: Enter your name : ? Enter rollno, marks in three subjects (each in separate lines): ? Output should be in the following format: Name Roll No Mark1 Mark2 Mark3 Total

Answers

Answered by HermioneGranger62
8

Answer:

Here is your answer mate:-

import.Java.util.*;

public class xyz

{

public static void main ( String args [] )

{

Scanner in = new Scanner (System.in);

int a,b,c=0;

a=94;

b=90;

c=91;

d=a+b+c;

System.out.println("Name:Khushi Raut");

System.out.println("Class:Xth B");

System.out.println("Marks in 1st subject:"+a);

System.out.println("Marks in 2nd subject:"+b);

System.out.println("Marks in 3rd subject:"+c);

System.out.println("Total:"+d);

}

}

Hope it's help :)

Similar questions