Codechef Problems: Entry Check (P1169)

 Problem Statement: 


Solution: 

Given: 
    X : Age of chef 
    10: Age restriction i.e., people with age of 10 years or more can visit the fair 

condition 1: x >= 10 (chef's age is greater than or equal to 10)
output: YES

condition 2: otherwise 
output: NO 

Code Solution: 

#include <bits/stdc++.h>

using namespace std;

int main() {
    int x;
    cin >> x;

    if (x >= 10) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;
}

Comments

Popular Posts