-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment11.java
More file actions
40 lines (28 loc) · 829 Bytes
/
Assignment11.java
File metadata and controls
40 lines (28 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package abhilash_Asignments;
//_ifElse statement 4 else if block statements
public class Assignment11 // class
{
public static void main(String[] args) // main method
{
int a = 7;
if (a < 0) //Given statement is false so it will not excute
{
System.out.println("a is negetive");
}
else if (a == 0) // Given statement is false so it will not excute
{
System.out.println("a is equal to zero.");
}
else if (a > 0 && a <= 5) // Given statement is false so it will not excute
{
System.out.println("a is grater than 0 and a is lesss or equal to five");
}
else if (a > 5 & a < 10) // the given Statement is true it will start excute
{
System.out.println("A is grater than five and A is lesser than ten");
}
else {
System.out.println("a is odd and greater than 10.");
}
}
}