Answers for "Odd or even program in java using a mod operator"

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"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language