Question

Question text Find four problems with this program: ------------------------------------------- using namespace std; // this program inputs...

Question text

Find four problems with this program:

-------------------------------------------

using namespace std;

// this program inputs three integers, determines if negative, positive, or zero

int main()

{

cout << "Enter an integer" << endl;

cin >> input;

  

if (input < 0);

cout << "The number is negative."  endl;

else

if (input > 0)

cout << "The number is positive" << endl;

else

cout << "The number is zero" << endl;

  

return 0;

}

programm c++ please and thank you

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <iostream>
using namespace std;
// this program inputs three integers, determines if negative, positive, or zero
int main()
{
   int input, i = 3;
   
   while(i>0){
      cout << "Enter an integer" << endl;
      cin >> input;
      
        
      if (input < 0)
         cout << "The number is negative."  <<endl;
      else
         if (input > 0)
            cout << "The number is positive" << endl;
      else
         cout << "The number is zero" << endl;
      i -= 1;
   }
   return 0;  
}

Add a comment
Know the answer?
Add Answer to:
Question text Find four problems with this program: ------------------------------------------- using namespace std; // this program inputs...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT