Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner; //import scanner to be able to read data from user.
- public class program1
- {
- public static void main(String[] args)
- {
- Scanner obj1 = new Scanner(System.in);
- System.out.print("Type 45: ");
- int x = obj1.nextInt(); //Waiting for input. And it scans it as an int.
- if(x == 45)
- {
- int y = 0;
- while(y < 101)
- {
- System.out.println(y);
- ++y;
- }
- }
- else
- {
- System.out.println("Error");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement