Answers for "Odd or even program in java using a mod operator Odd or even program in java using a mod operator to find the number is odd number or even number in java using the basic operator mod"

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 "Odd or even program in java using a mod operator Odd or even program in java using a mod operator to find the number is odd number or even number in java using the basic operator mod"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language