Write a Java program to enter a number. If the number is negative even, display four succeeding even numbers. If the number is positive odd, display four preceding odd numbers otherwise display the message ‘Number is neither negative even nor a positive odd’.
Answers
Answered by
1
Answer:
Java Program to Check if a Given Integer is Odd or Even
import java.util.Scanner;
public class Odd_Even.
{
public static void main(String[] args)
{
int n;
Scanner s = new Scanner(System. in);
System. out. print("Enter the number you want to check:");
More items...
Explanation:
Similar questions
English,
2 days ago
Math,
2 days ago
Physics,
8 months ago
World Languages,
8 months ago
Math,
8 months ago