My issue
if a/7 then what should we write to find if a is divisible by 7 or not
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int a;
cin>>a;
// your code goes here
if (a/2==0 && a/7==){
cout<<"ALICE"<<endl;
}
else if(a/2==1 && a/9==){
cout<<"BOB"<<endl;
}
else{
cout<<"CHARLIE"<<endl;
}
}
return 0;
}
Learning course: Basic Math using C++
Problem Link: Favourite Numbers Practice Problem in - CodeChef