Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //9
- public class MyClass {
- public static void main(String args[]) {
- for(int i = 1;i <= 10;i++)
- System.out.println(i);
- }
- }
- //10
- public class MyClass {
- public static void main(String args[]) {
- java.util.Scanner scanner = new java.util.Scanner(System.in);
- double number = scanner.nextDouble();
- while (number >= 0) {
- System.out.printf("Result: %.2f \n", number * 2);
- number = scanner.nextDouble();
- }
- System.out.println("Negative number!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement