Upload files to "OOP/Java/Lab/Week1"
This commit is contained in:
parent
8542582101
commit
181f9113d2
7
OOP/Java/Lab/Week1/HelloWorld.java
Normal file
7
OOP/Java/Lab/Week1/HelloWorld.java
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
class HelloWorld
|
||||||
|
{
|
||||||
|
public static void main(String args[])
|
||||||
|
{
|
||||||
|
System.out.println("Hello, World.");
|
||||||
|
}
|
||||||
|
}
|
18
OOP/Java/Lab/Week1/OddNumbers.java
Normal file
18
OOP/Java/Lab/Week1/OddNumbers.java
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user