MCsephiroth13
Member
Hey guys, I'm really new to Java and I'm trying to write a short program that inputs the names and ages of people until the age reaches 100. I know you'd need a 'while' statement, but I'm not sure how to configure it.
Also, this is optional, but how would I print 10 random integers between 1 and 10 inclusive?
For the age thing: Meh?
Also, this is optional, but how would I print 10 random integers between 1 and 10 inclusive?
For the age thing: Meh?
Code:
import java.util.Scanner;
class ghhjghjgj{
static void main(String [] args){
Scanner reader = new Scanner(System.in);
int age;
age = reader.nextInt();
while (age <= 100){
System.out.print(age);
age++;
}
}
}