You're given a number N. If N is divisible by 5 or 11 but not both then print "ONE"(without quotes). If N is divisible by both 5 and 11 then print "BOTH"(without quotes). If N is not divisible by 5 or 11 then print "NONE"(without quotes).

You're given a number N. If N is divisible by 5 or 11 but not both then print "ONE"(without quotes). If N is divisible by both 5 and 11 then print "BOTH"(without quotes). If N is not divisible by 5 or 11 then print "NONE"(without quotes).






OURSHOPKEEPER









#include <iostream>
using namespace std;
 int main(){
     int N;
     cin>>N;
     if(N%5==0 && N%11==0){
      cout<<"BOTH"
     } 
     else if(N%5 || N%11==0){
         cout<<"ONE";
     }
     else
     cout<<"NONE";
 }




    


Click on the above button to download the code.



Post a Comment

If you have furthur QUERIES please let us know

Previous Post Next Post