0% found this document useful (0 votes)
33 views

Java If Else English

This document describes an if-else problem statement in Java that tests knowledge of if-else statements. The problem takes an integer N as input and prints either "Weird" or "Not Weird" depending on whether N is odd, even and within certain ranges, or greater than 20. The editor provides partially completed code to complete to solve the problem based on these conditions.

Uploaded by

RAHUL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Java If Else English

This document describes an if-else problem statement in Java that tests knowledge of if-else statements. The problem takes an integer N as input and prints either "Weird" or "Not Weird" depending on whether N is odd, even and within certain ranges, or greater than 20. The editor provides partially completed code to complete to solve the problem based on these conditions.

Uploaded by

RAHUL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Java

If-Else
Problem Statement
Using "if-else" you can perform decision making in Java. See the flowchart below (taken from wikipedia):

This problem will test your knowledge on "if-else" statements.


Given an integer N as input, check the following:
If N is odd, print "Weird".
If N is even and, in between the range of 2 and 5(inclusive), print "Not Weird".
If N is even and, in between the range of 6 and 20(inclusive), print "Weird".
If N is even and N

> 20, print "Not Weird".

We given you partially completed code in the editor, complete it to solve the problem.
Input Format
There is a single line of input: integer N .
Constraints

1 N 100
Output Format
Print "Weird" if the number is weird. Otherwise, print "Not Weird". Do not print the quotation marks.
Sample Input 1
3

Sample Output 1
Weird

Sample Input 2
24

Sample Output 2
Not Weird

You might also like