Java conditions
The quiz presents a Java code that takes an input and prints an output based on some conditions. Take the quiz and test your understanding about conditional statements
👁 464
statistics
calculate
Questions #: 5
Time:
Pass Score: 80.0%
1import java.util.Scanner;
2 public class Exe_Java_Condition {
3 public static void main(String[] args)
{
4 Scanner in = new Scanner(System.in);
5 System.out.print("Input number: ");
6 int input = in.nextInt();
7 if (input > 0)
{
8 System.out.println("Positive Number");
9 }
else if (input < 0)
{
10 System.out.println("Negative Number");
11}
else
{
12 System.out.println("Zero");
13 }
14 }
15 }
Views:
Trials:
Avg score:
0
sin
cos
tan
sin-1
cos-1
tan-1
π
e
xy
x3
x2
ex
10x
y√x
3√x
√x
ln
log
(
)
1/x
%
n!
7
8
9
+
MS
4
5
6
–
M+
1
2
3
×
M-
0
.
EXP
÷
MR
±
RND
C
=
MC
|
Document Actions