opzioni binarie ricarica con paypal A number is said to be even if it is divisible by 2.  otherwise odd.

waltham watches dating Let us now see an example of a java program to determine whether the given number is an odd or even number.


Questo perché in quel momento RSI si trova in una zona di ipercomprato sopra 80 see e ipervenduto sotto i 20.. , cashback, Step 1: Start. Step 2:  Read n.

q option binario Step 3:  if n%2 == 0, then print n is even. Step 4: else print n is odd.

click here Step 5: Stop.

Source code:



click In the program, integer entered by the user is stored in variable num.

Then, whether the number is perfectly divisible by 2 or not is checked using modulus operator.

If the number is perfectly divisible by 2, test expression num%2 == 0  evaluates to 1 (true) and the number is even.

However, if the test expression evaluates to 0 (false), the number is odd.



C:\Users\santo\Desktop\new>java Even

*** ***

<< JAVA Program to check whether the given number is even or not >>

Enter number:
9 is odd

Screenshot of output:

Screenshot of output

Leave a Reply

Your email address will not be published. Required fields are marked *