write a program to print your name and age in java using while loop
Answers
Answered by
1
class Brainly
{
public static void main(String args[])
{
Scannersc=newScanner(System.in);
System.out.println("Enter your name and age");
string n=sc.next();
int a=sc.nextInt();
int f=1;
while(f<=10) [note-In place of 10 write the no. how much time you want to print]
{
System.out.println(n);
System.out.println(a);
}
}
}
Mark it as brainliest if You like it
{
public static void main(String args[])
{
Scannersc=newScanner(System.in);
System.out.println("Enter your name and age");
string n=sc.next();
int a=sc.nextInt();
int f=1;
while(f<=10) [note-In place of 10 write the no. how much time you want to print]
{
System.out.println(n);
System.out.println(a);
}
}
}
Mark it as brainliest if You like it
Similar questions