Please write a code for below:
Warren has declared and set two int variables named x and y. He wants the code to print "Larger" if x is strictly greater than y, and "Smaller" otherwise. But your code should not print anything unless a boolean flag variable named print is set to true.

Respuesta :

Answer:

int main()  

{  

   int x,y;  

   bool b1, b2;  

   cout<<"enter values of x : ";

   cin>>x;

   cout<<"enter values of y : ";

   cin>>y;

   b1 = y > x; // false  

     

   b2 = x > y; // true  

     

   cout << "b1 is = " << b1 << "\n";  

   cout << "b2 is = " << b2 << "\n";  

     

   if (b2)  

       cout<<endl << "Larger Number" << "\n";  

   else

       cout << "Smaller Number" << "\n";  

         

     

return 0;  

}

Ver imagen faisalhafeezfaisal78
RELAXING NOICE
Relax