Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Chef wants to appear in a competitive exam. To take the exam, there are following requirements:
Chef’s current Age is AA. Find whether he is currently eligible to take the exam or not.
For each test case, output YES
if Chef is eligible to give the exam, NO
otherwise.
You may print each character of the string in uppercase or lowercase (for example, the strings YES
, yEs
, yes
, and yeS
will all be treated as identical).
Input:
5
21 34 30
25 31 31
22 29 25
20 40 15
28 29 28
Output:
YES
NO
YES
NO
YES
Test case 1: The age of Chef is 3030. His age satisfies the minimum age limit as 30 \ge 2130≥21. Also, it is less than the upper limit as 30 \lt 3430<34. Thus, Chef is eligible to take the exam.
Test case 2: The age of Chef is 3131. His age satisfies the minimum age limit as 31 \ge 2531≥25. But, it is not less than the upper limit as 31 \nless 3131≮31. Thus, Chef is not eligible to take the exam.
Test case 3: The age of Chef is 2525. His age satisfies the minimum age limit as 25 \ge 2225≥22. Also, it is less than the upper limit as 25 \lt 2925<29. Thus, Chef is eligible to take the exam.
Test case 4: The age of Chef is 1515. His age does not satisfy the minimum age limit as 15 \lt 2015<20. Thus, Chef is not eligible to take the exam.
#include <iostream>
using namespace std;
int main() {
int t,x,y,a;
cin>>t;
while(t--)
{
cin>>x>>y>>a;
if(a>=x && a<y){
cout<<"YES"<<endl;
}
else
{
cout<<"NO"<<endl;
}
}
return 0;
}
t=int(input())
for i in range(t):
x,y,a=map(int,input().split())
if a>=x and a<y:print("Yes")
else: print ("No")
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc =new Scanner(System.in);
int t=sc.nextInt();
while(t-- > 0)
{
int x = sc.nextInt();
int y =sc.nextInt();
int a=sc.nextInt();
if(a>=x && a<y)
{
System.out.println("yes");
}
else
{
System.out.println("no");
}
}
}
}
In our experience, we suggest you solve this Age Limit CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
If you are stuck anywhere between any coding problem, just visit Queslers to get the Age Limit CodeChef Solution
I hope this Age Limit CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>