From 79f34ca5529dc559934055aeb01e4542f84aa69c Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Thu, 17 Jan 2019 20:47:22 +0300 Subject: [PATCH] Three --- src/lab/one/Three.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/lab/one/Three.java diff --git a/src/lab/one/Three.java b/src/lab/one/Three.java new file mode 100644 index 0000000..708d1a5 --- /dev/null +++ b/src/lab/one/Three.java @@ -0,0 +1,24 @@ +package lab.one; + +import java.util.Scanner; + +public class Three { + + @SuppressWarnings({ "unused", "resource" }) + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int number; + System.out.println("Enter a number: "); + try { + number = sc.nextInt(); + if ( number != 7 ) + System.out.print( "Welcome " ); + + if ( ( number % 5 ) == 0 ) + System.out.println( "To Java Programming" ); + } catch (Exception e) { + e.printStackTrace(); + } + } + +}