Change case, repeat last action, thesaurus, <span>Disable hyperlinks.</span>
Answer:
#include <iostream>
using namespace std;
int main(){
int a, b, c;
cout<<"Enter three integers: ";
cin>>a>>b>>c;
if(a<=b && a<=c){
cout<<"Smallest: "<<a; }
else if(b<=a && b<=c){
cout<<"Smallest: "<<b; }
else{
cout<<"Smallest: "<<c; }
return 0;
}
Explanation:
This line declares three integer variables a, b and c
int a, b, c;
This line prompts the user for three integer inputs
cout<<"Enter three integers: ";
This line gets the inputs
cin>>a>>b>>c;
This checks if the first is the smallest
if(a<=b && a<=c){
If yes, it prints the first as the smallest
cout<<"Smallest: "<<a; }
This checks if the second is the smallest
else if(b<=a && b<=c){
If yes, it prints the second as the smallest
cout<<"Smallest: "<<b; }
If the above conditions are not true, then the third number is printed as the smallest
<em> else{</em>
<em> cout<<"Smallest: "<<c;</em>
<em> }</em>
<em />
Answer:
True
Explanation:
in function guess:- a = x; b = y; c = z
so 45 > 31 AND 45 < 38
since both the stements are true
True is printed