Answer to Question #81673 in C++ for David

Question #81673
#include <iostream>
#include <cstdlib>
using namespace std;

int main()
{
int num;

do
{
cout << "Enter an integer: ";
cin >> num;

cout << "\nNumber: " << num;

if (num > 0)
cout << "\nMagnitude: Positive";
else if (num < 0)
cout << "\nMagnitude: Negative";
else
cout << "\nMagnitude: Zero";

if (num % 2 == 0)
cout << "\nType: Even";
else
cout << "\nType: Odd";
cout << "\n\n";
}
while ();

return 0;
}

So I want the program to terminate the loop when the user enters a negative odd integer but I've been struggling to find the correct expression to fit.
1
Expert's answer
2018-10-04T02:20:35-0400
Dear David, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

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