let number = 15;
if(number % 2 ==0){
console.log( number + 'is Even Number');
}
else{
console.log(number " is Odd Number");
}
/* Program to check whether the input integer number
* is even or odd using the modulus operator (%)
*/
#include<stdio.h>
int main()
{
// This variable is to store the input number
int num;
printf("Enter an integer: ");
scanf("%d",&num);
// Modulus (%) returns remainder
if ( num%2 == 0 )
printf("%d is an even number", num);
else
printf("%d is an odd number", num);
return 0;
}
a = int(input("Enter the number: "))
if (a % 2) == 0:
print("{0} is even".format(a))
else:
print(" {0} is odd ".format(a))
public class EvenOdd{
public static void evenOddValue(int value) {
if(value % 2 == 0){
System.out.println("The given value is even: " + value);
}
else{
System.out.println("The given value is odd: " + value);
}
}
public static void main(String [] args) {
int num = 25;
EvenOdd obj = new EvenOdd();
obj.evenOddValue(num);
}
}
def is_even(num):
return not bool(num % 2)