Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

odd even condition

let number = 15;
if(number % 2 ==0){
	console.log( number + 'is  Even Number');
}
else{
	console.log(number " is Odd Number");
}
Comment

Even or 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;
}
Comment

odd or even checker

a = int(input("Enter the number: "))
if (a % 2) == 0:
    print("{0} is even".format(a))
else:
    print(" {0} is odd ".format(a))
Comment

odd or even

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);
     }
}
Comment

check a number is odd or even

def is_even(num):
	return not bool(num % 2)
Comment

PREVIOUS NEXT
Code Example
Python :: write a python program which accepts the user 
Python :: stop animation matplotlib 
Python :: python Hewwo wowwd 
Python :: take input from clipboard python 
Python :: Using a generic exception block 
Python :: Streaming upload requests python 
Python :: pandas 3d set camara cords 
Python :: python get next item from generator 
Python :: dataset analysis in python photo photoelectric effect 
Python :: how to print a text 
Python :: how to convert 2 dimensional in 1 dimensional array 
Python :: customise django admin edit model button in field 
Python :: range coding 
Python :: blueprint flask 
Python :: python convert string to raw string 
Python :: python to pseudo code converter online 
Python :: python transpose a list 
Python :: how to get user input in python 
Python :: login view django 
Python :: change value in dataframe 
Python :: mysql_python 
Python :: ros python service client 
Python :: calculation in python 
Python :: validate 
Python :: python dunder methods 
Python :: pandas columns 
Python :: setdefault python 
Python :: show columns with nan pandas 
Python :: lists in python 
Python :: runtime errors in python 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =