Computer Science, asked by mariyasibi10, 4 months ago

Write a program to cheak the Given number is Odd or
Even

Answers

Answered by purveshKolhe
8

\huge{\red{\underline{\underline{\mathfrak{\pink{\bigstar Java:: \bigstar}}}}}}

import java.util.Scanner;

public class Main {

    public static void main(String [] args) {

         Scanner sc =  new scanner(System.in);

         int usin = sc.nextInt();

         if (usin % 2 == 0) {

              System.out.println("The given number is even.");

         }

         else {

              System.out.printlhn("The given number is odd.");

         }

    }

}

\purple{\rule{300pt}{0.25em}}

\huge{\red{\underline{\underline{\mathfrak{\pink{\bigstar C++:: \bigstar}}}}}}

#include <iostream>

using namespace std;

int main() {

    int usin;

    cin >> usin;

    if (usin % 2 == 0) {

         cout << "The given number is even.";

    }

    else {

         cout << "The given number is odd.";

    }

    return 0;

}

\purple{\rule{300pt}{0.25em}}

\huge{\red{\underline{\underline{\mathfrak{\pink{\bigstar Python:: \bigstar}}}}}}

usin = int(input())

if usin % 2 == 0:

    print("The given number is even.")

else:

    print("The given number is odd.")

\purple{\rule{300pt}{0.25em}}

Hope it helps..♪

Similar questions