Welcome

>>>Welcome to my "CODE BAZAR"
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others

Update ✔✔✔ Upcoming programming book (.pdf) "Programming Contest (data structures and algorithms) by Md. Mahbub Hasan & "Graph Algorithms" by Safayat Asraf "****** Date: 20 March, 2019****Hazrat Ali****

Sunday 30 October 2016

J. Odd or Even

Problem link
https://algo.codemarshal.org/contests/diu-122-fl16-termwork/problems/J

Score: 1

CPU: 1s
Memory: 512MB

Given an integer, your task is to determine whether it is odd or even.

Input

An integer n (1<=n<=100).

Output

If is n is odd print odd. Otherwise print even.

Samples

InputOutput
5odd
InputOutput
8even


Solution

#include<stdio.h>
int main()
{
    int n;
    scanf("%d",&n);
    if(n>=1 && n<=100){
        if(n%2==0){
            printf("even\n");
        }
        else{
            printf("odd\n");
        }
    }
    return 0;
}

No comments:

Post a Comment