In: Computer Science
1. C++ program to accept three values and checks the conditions
Flow chart
Source Code
#include<iostream>
using namespace std;
int main() {
int R,T,Q;
cout<<" Enter value for first number:";
cin>>R;
cout<<" Enter value for second number:";
cin>>T;
cout<<" Enter value for third number:";
cin>>Q;
if(R-T+4*Q<820) {
cout<<" The values for R :"<<R<<" T:"<<T<<" Q:"<<Q;
}
return 0;
}
The output:
Enter value for first number:12
Enter value for second number:60
Enter value for third number:45
The values for R :12 T:60 Q:45
2. C++ program to accept two values and check conditions
Flowchart:
Source code:
#include<iostream>
using namespace std;
int main() {
int X,Y;
cout<<" Enter value for first number:";
cin>>X;
cout<<" Enter value for second number:";
cin>>Y;
if(X>Y) {
cout<<" The values of variables X :"<<X<<" and Y:"<<Y;
}
return 0;
}
Output