|
-
June 18th, 2011, 12:10 AM
#1
C++
#include<iostream>
using namespace std;
int main()
{
int data;
cout<<"Enter 0 to stop entering data and display product";
cout << endl;
while (data !=0)
{
cout << "Enter data:";
cin >> data;
}
system("pause");
return 0;
}
I've done it all except I need to calculate ONLY POSITIVE NUMBERS the product of them
-
June 18th, 2011, 11:06 AM
#2
Re: C++
 Originally Posted by Lilcrew
I've done it all except I need to calculate ONLY POSITIVE NUMBERS the product of them
You really haven't done anything except write a loop that gets input from the keyboard. You haven't written anything to solve the problem you're stating.
If this is homework, then you need to make more of an attempt.
Regards,
Paul McKenzie
-
June 21st, 2011, 01:00 AM
#3
Re: C++
you will get endless loop if the input isn't integer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|