Showing posts with label even odd. Show all posts
Showing posts with label even odd. Show all posts

Check Even or Odd in C++

This program checks if a given number is even or odd.

#include <iostream>

int main() {

    int number;

    std::cout << "Enter a number: ";

    std::cin >> number;

    if (number % 2 == 0) {

        std::cout << number << " is even." << std::endl;

    } else {

        std::cout << number << " is odd." << std::endl;

    }

    return 0;

}


Check Even or Odd in C

This program checks if a given number is even or odd.

#include <stdio.h>

 int main() {
    int number;
    printf("Enter a number: ");
    scanf("%d", &number);
    if (number % 2 == 0) {
        printf("%d is even.\n", number);
    } else {
        printf("%d is odd.\n", number);
    }
    return 0;
}


Check Even or Odd in Python

This program checks if a given number is even or odd.

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

MS Excel Logical Functions

Logical functions in Excel are powerful tools that help you make decisions based on conditions. Whether you're comparing values or testi...

Post Count

Loading...