Answer to Question #333567 in C++ for Rille

Question #333567

Create a C++ program to accept two integers and check if it is greater than or equal to 20. Explain and how it works?

1
Expert's answer
2022-04-25T13:37:40-0400


//Explain in code with comment
#include <iostream>
using namespace std;


int main()
{
  int a,b;
  cout<<"Input a:=";
  cin>>a;
  cout<<"Input b: ";
  cin>>b;
  if(a>=20&&b>=20)//Check each integers numbers if a also b 
    //is equal or greater to 20 then do 
  {
    cout<<"Yes both numbers are greater or equal\n\n";
  }
  //if a and b are less than 20 then do
  else
  {
    cout<<"No\n\n"; 
  }
  return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS