Answers for "java program to check even or odd without using modulus and division"

0

Odd or even program in java using a mod operator

import java.util.Scanner;public class Main{public static void main(String[] args){Scanner reader = new Scanner(System.in);System.out.print("Enter a number: ");int num = reader.nextInt();if(num % 2 == 0)System.out.println(num + " is even");elseSystem.out.println(num + " is odd");}}
Posted by: Guest on June-12-2021

Code answers related to "java program to check even or odd without using modulus and division"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language