Advertisement
mmayoub

Ex01, 05.06.2021

Jun 5th, 2021
1,172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Ex01 {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner in = new Scanner(System.in);
  7.         double n1, n2;
  8.  
  9.         System.out.println("enter n1 value: ");
  10.         n1 = in.nextDouble();
  11.  
  12.         System.out.println("enter n2 value: ");
  13.         n2 = in.nextDouble();
  14.  
  15.         if (n1 > 9) {
  16.             n1 = 5;
  17.         } else {
  18.             n1 = 3;
  19.         }
  20.  
  21.         System.out.println("n1 = " + n1);
  22.         System.out.println("n2 = " + n2);
  23.  
  24.         in.close();
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement