Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Ex03 {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- int y;
- int c = 0;
- System.out.print("Enter your grade (0 to 100): ");
- y = in.nextInt();
- while (y >= 0 && y <= 100) {
- c++;
- System.out.print("Enter your grade (0 to 100): ");
- y = in.nextInt();
- }
- System.out.println("You have " + c + " grades");
- in.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement