mmayoub

Ex04, 01.05.2021

May 4th, 2021
574
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.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×