Question: Is a Number Between 1 and 1 0 0 ? Check to see if userNumber is between 1 and 1 0 0 . If it

Is a Number Between 1 and 100?
Check to see if userNumber is between 1 and 100.
If it is, create a for loop that prints all integer values starting with userNumber and going down to 1.
Otherwise, print "Your number was not between 1 and 100." to the console.
import java.util.Scanner;
public class CodingQuestion {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int userNumber = in.nextInt();
/****** DO NOT CHANGE THE CODE ABOVE THIS LINE ******/
// WRITE YOUR CODE HERE
/****** DO NOT CHANGE THE CODE BELOW THIS LINE ******/
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!