Write a Java program that write your name ,class , rollno., age
Answers
Answered by
1
Answer:
Explanation:
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);
}
}
Similar questions