Friday, February 14, 2020

Java program enter Student Details and find total of marks.

import java.util.Scanner;
public class StudentDetails
{
    public static void main(String[] args)
        {
        Scanner sc=new Scanner(System.in);
        System.out.print("Enter your Name:");
        String name=sc.next();
        System.out.print("Enter your Register no:");
        int register =sc.nextInt();
        System.out.print("Enter your Course");
        String course=sc.next();
        System.out.print("Enter your Place");
        String place=sc.next();
        System.out.print("Enter your Class");
        String cls=sc.next();
        System.out.print("Enter your  marks");
        int mark1=sc.nextInt ();
        int mark2=sc.nextInt ();
        int mark3=sc.nextInt ();
       int marks=mark1+mark2+mark3;
        sc.close ();
        System.out.println("\nName :"+name+"\nRegister no :"+register+"\nCourse :"+course+"\nPlace :"+place+"\nClass :"+cls+"\nTotal Marks :"+marks);
   
    }
}

No comments:

Post a Comment