Skip to content

Commit 17b8daf

Browse files
Merge pull request #18 from Vedansh-Keshari/Vedansh1
Added solution for positive and negative number
2 parents 1249152 + f40f490 commit 17b8daf

2 files changed

Lines changed: 23 additions & 12 deletions

File tree

Basic Codes/Positive_Negative.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import java.util.*;
2+
public class Positive_Negative {
3+
public static void main(String args[]){
4+
Scanner sc=new Scanner(System.in);
5+
System.out.println("Enter any number");
6+
int n=sc.nextInt();
7+
if(n>=0){
8+
System.out.println("Positive");
9+
}
10+
else {
11+
System.out.println("Negative");
12+
13+
}
14+
}
15+
}

Basic Codes/multiple_of_two.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
class multiple_of_two {
2-
public static void main(String args[])
3-
{
4-
int a = 2;
5-
if(a%2==0)
6-
{
7-
System.out.print("Multiple of two");
8-
}
9-
else
10-
{
11-
System.out.print("Not multiple of two ");
12-
}
13-
}
2+
public static void main(String args[]) {
3+
int a = 2;
4+
if (a % 2 == 0) {
5+
System.out.print("Multiple of two");
6+
} else {
7+
System.out.print("Not multiple of two ");
8+
}
9+
}
1410
}

0 commit comments

Comments
 (0)