Computer Science, asked by Onesarthak007, 2 days ago

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 jyotikhanna1983k
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