Computer Science, asked by sambitnayak3937, 9 months ago

write a java program to print your name and roll no. in the same line and class in next line

Answers

Answered by ramabisa
2

Answer:

Explanation:

import java.util.Scanner;

class student

{

public static void main(String[]args)

{

Scanner in = new Scanner(System.in);

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

String name = in.nextLine();

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

int roll_no = in.nextInt();

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

int class = in.nextInt();

System.out.println("Name: " + name + "Roll.No: " + roll_no);

System.out.println("Class: " + class);

}

}

Hope this program helps you!!

Similar questions