Design a program in Java to display the following information on the output screen: Name: ............. Class:.......Roll no.:........ School:.............
Answers
Answer:
import java.util.Scanner;
public class age
{
public static void main()
{
Scanner sc = new Scanner(System.in);
System.out.println("enter your name ");
String name = sc.next();
System.out.println("enter your Class ");
int clss=sc.nextInt();
System.out.println("enter your roll no. ");
int rno=sc.nextInt();
System.out.println("enter your School ");
String school = sc.next();
System.out.println(" Name: "+name+" Class:"+clss+"Roll no.:"+rno+" School:"+school);
}
}
Explanation:
Answer:
class age{
public static void main(String args[]){
System.out.println("Name:Atharv");
System.out.println("IX "B"");
}
}
Explanation: