Unlimited Positive Inputs
Write a program that will ask the user to input n positive numbers. The program will terminate if one of those number is not positive.
#include <iostream>
using namespace std;
int main()
{
long int num = 0;
while( num >= 0 )
{
cout << "Enter a postive number: ";
cin >> num;
}
return 0;
}
using namespace std;
int main()
{
long int num = 0;
while( num >= 0 )
{
cout << "Enter a postive number: ";
cin >> num;
}
return 0;
}
Please help me improve my work by letting me know about mistakes (if any) I mad in the project given above, by commenting on the particular post.
0 comments:
Post a Comment
Thanks for visiting my Blog.
Have any problem, feel free to contact us via Email: asadalipkp9@gmail.com
Have a nice day!