From 181f9113d29fb9ff828bda975f4e44d085314386 Mon Sep 17 00:00:00 2001 From: aadit Date: Mon, 5 Aug 2024 01:06:44 +0530 Subject: [PATCH] Upload files to "OOP/Java/Lab/Week1" --- OOP/Java/Lab/Week1/HelloWorld.java | 7 +++++++ OOP/Java/Lab/Week1/OddNumbers.java | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 OOP/Java/Lab/Week1/HelloWorld.java create mode 100644 OOP/Java/Lab/Week1/OddNumbers.java diff --git a/OOP/Java/Lab/Week1/HelloWorld.java b/OOP/Java/Lab/Week1/HelloWorld.java new file mode 100644 index 0000000..8bf2e17 --- /dev/null +++ b/OOP/Java/Lab/Week1/HelloWorld.java @@ -0,0 +1,7 @@ +class HelloWorld +{ + public static void main(String args[]) + { + System.out.println("Hello, World."); + } +} \ No newline at end of file diff --git a/OOP/Java/Lab/Week1/OddNumbers.java b/OOP/Java/Lab/Week1/OddNumbers.java new file mode 100644 index 0000000..5144604 --- /dev/null +++ b/OOP/Java/Lab/Week1/OddNumbers.java @@ -0,0 +1,18 @@ +class OddNumbers +{ + public static void main(String args[]) + { + int a,i; + + System.out.println("Odd Numbers List from 1 to 100."); + + for(i=1;i<=100;i++) + { + a = i; + if(i%2 != 0){ + System.out.println(+a); + } + } + + } +} \ No newline at end of file