/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// الكائن المسؤول عن المدخلات
Scanner sc = new Scanner(System.in);
System.out.println("Enter a number: ");
int number = sc.nextInt();
System.out.println("Is Prime: " + isPrime(number));
if(number % 2 == 0)
// العدد زوجي
System.out.println(number + " is even");
else
// العدد فردي
System.out.println(number + " is odd");
}
private static boolean isPrime(int num) {
boolean flag = false;
for(int i = 2; i <= num/2; ++i)
{
if(num % i == 0)
{
flag = true;
break;
}
}
return !flag;
}
}