Advertisement
psi_mmobile

Untitled

May 4th, 2022
721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. //9
  2. public class MyClass {
  3.     public static void main(String args[]) {
  4.         for(int i = 1;i <= 10;i++)
  5.         System.out.println(i);
  6.     }
  7. }
  8. //10
  9. public class MyClass {
  10.     public static void main(String args[]) {
  11.         java.util.Scanner scanner = new java.util.Scanner(System.in);
  12.         double number = scanner.nextDouble();
  13.         while (number >= 0) {
  14.             System.out.printf("Result: %.2f \n", number * 2);
  15.             number = scanner.nextDouble();
  16.         }
  17.         System.out.println("Negative number!");
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement