0
How to create a Java program that accepts a name, age and year of birth and then outputs it?
Help
9 Respuestas
+ 3
Jul Maglinte kindly share your attempt Firstly then only we can help you. Hope you'll share the attempt. but yeah I'll give you some resources if you wanna actually learn this thing. here these are -
https://code.sololearn.com/cPpVdbS2xbey/?ref=app
https://code.sololearn.com/c9aXq79t1q8V/?ref=app
https://code.sololearn.com/cePb2xb04CPB/?ref=app
I hope this will help ✌️
+ 3
import java.util.*;
class prg
{
public static void main()
{
Scanner s=new Scanner(System.in);
System.out.println("Enter your name :");
String st=s.nextLine();
System.out.println("Enter your age :");
int age=s.nextInt();
System.out.println("Enter your year of birth :");
String yr=s.nextLine();
System.out.println("Name :"+st);
System.out.println("Age :"+age);
System.out.println("Year of birth :"+yr);
}
}
Hope it works for you!
Thank you 🙂.
+ 2
Take input string as a name ,one int variable for age and other variable for year of birth and display it by using System.out.println("name "+name)
Age and birth
+ 1
What is the output
0
Where is your attempt ?
0
Shucayb
0
Write a Java program that fully demonstrate single dimensional array.
0
import java.util.Scanner;
public class Userinformation {
public static void main(String[] args) {
Scanner s= new Scanner(System.in);
System.out.println("Enter Your Name: ");
String st=s.nextLine();
System.out.println("Enter Your Age: ");
int age=s.nextInt();
System.out.println("Enter Your Class Name: ");
int classname=s.nextInt();
System.out.println("Name"+st);
System.out.println("Age"+age);
System.out.println("Class"+classname);
}
}
0
Xhh