Computer Science, asked by royalrohitashsingh1, 10 months ago

Write a JAVA program to print your Name, Class, Roll .no and School

Answers

Answered by legendspelly
81

Answer:

Java Program:

import java.util.*;

class MyProfile

{

public void main()

{

Scanner sc=new Scanner(System.in);

System.out.println("Enter your name");

String n=sc.next();

System.out.println("Enter your class");

int c=sc.nextInt();

System.out.println("Enter your marks");

int m=sc.nextInt();

System.out.println("Enter your roll number");

int rn=sc.nextInt();

System.out.println("Name :"+n);

System.out.println("Class "+c);

System.out.println("Roll number "+rn);

System.out.println("Marks "+m);

}

}

---------------------------------------------------------------Hope it helps !

Explanation:

Answered by abhilashdubeyjhansi
45

Answer:

This image contain the correct Answer for this question

Attachments:
Similar questions