Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Chef’s phone shows a Battery Low notification if the battery level is 15% or less.
Given that the battery level of Chef’s phone is X%, determine whether it would show a Battery low notification.
For each test case, output in a single line Yes, if the battery level is 15% or below. Otherwise, print No.
You may print each character of Yes and No in uppercase or lowercase (for example, YeS, YES, yes will be considered identical).
Subtask #1 (100 points): original constraints
Input: 3
15
3
65
Output: Yes
Yes
No
Test Case 1: The battery level is 15. Thus, it would show a battery low notification.
Test Case 2: The battery level is 3, which is less than 15. Thus, it would show a battery low notification.
Test Case 3: The battery level is 65, which is greater than 15. Thus, it would not show a battery low notification.
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--)
{
int x;
cin >> x;
if(x>15)
{
cout << "No" << endl;
}
else
cout<<"Yes"<<endl;
}
return 0;
}
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner scn= new Scanner(System.in); //System.in is a standard input stream
int T= scn.nextInt();
for(int i=0; i<T; i++){
int X= scn.nextInt();
if(X<=15){
System.out.println("YES");
}
else{
System.out.println("NO");
}
}
}
}
T = int(input())
for i in range(T):
X =int(input())
if X<=15:
print("Yes")
else:
print("No")
In our experience, we suggest you solve this Battery Low 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 Battery Low CodeChef Solution
I hope this Battery Low 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 >>