write a program to accept name, roll no, class and school from user and print it 's in following pattern.
BIO DATA
Name: Isma Tahseen Naz
roll no:10
class: X
school: A.A.E.school
Answers
Answered by
1
Question:-
Write a program to accept name, roll number, class and school from user and print them.
Solution:-
import java.util.*;
class BioData
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter your name: ");
String name=sc.nextLine();
System.out.print("Enter your Roll Number: ");
int roll=sc.nextInt();
System.out.print("Enter your Class: ");
String Class=sc.next();
System.out.print("Enter your School Name: ");
String school=sc.nextInt();
System.out.println("BIO DATA");
System.out.println("Name: "+name);
System.out.println("Roll Number: "+roll);
System.out.println("Class: "+Class);
System.out.println("School: "+school);
}
}
Similar questions
English,
4 months ago
English,
4 months ago
Math,
9 months ago
Social Sciences,
9 months ago
Computer Science,
1 year ago
Physics,
1 year ago
English,
1 year ago