Write a c++ program to determine whether two integers are both positive, both negative or both zeros
Answers
Answered by
0
Step-by-step explanation:
#include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a;
cin >> b;
if(a>0 && b>0){
cout << a << " and " << b << " are positive." << endl;
}
else if(a>0 && b<0){
cout << a << " is positive and " << b << " is negative." << endl;
}
else if(a<0 && b>0){
cout << a << " is negative and " << b << " is positive." << endl;
}
else if(a<0 && b<0){
cout << a << " and " << b << " are negative." << endl;
}
return 0;
}
Answered by
1
Answer:
Hope it will help you.
Attachments:
Similar questions