Advertisement
mmayoub

Ex04, 01.05.2021

May 4th, 2021
888
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package prj01052021;
  2.  
  3. // 01.05.2021
  4. import java.util.Scanner;
  5.  
  6. public class Ex04 {
  7.  
  8.     public static void main(String[] args) {
  9.         Scanner in = new Scanner(System.in);
  10.  
  11.         int a, b, c;
  12.  
  13.         // input data from user
  14.         System.out.print("Enter a: ");
  15.         a = in.nextInt();
  16.         System.out.print("Enter b: ");
  17.         b = in.nextInt();
  18.         System.out.print("Enter c: ");
  19.         c = in.nextInt();
  20.  
  21.         if ((a < b + c) && (b < a + c) && (c < a + b)) {
  22.             System.out.println("Mothalth OK");
  23.             System.out.println("Moheet = " + (a + b + c));
  24.         } else {
  25.             System.out.println("Error");
  26.         }
  27.  
  28.         in.close();
  29.     }
  30.  
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement