|
-
October 13th, 2009, 05:53 PM
#3
Re: Prining a * from a user input integer Loop Help
 Originally Posted by ashley19
How can I make it continually loop? It only asks for it one time? Is it possible to stop it after 5 times? Do I need a control condition/while loop?
or
is it possible to have the user input 5 integers in the beginning and have the output show at the end?
Code:
#include <iostream>
#include <vector>
using namespace std;
int main()
{
std::vector<int> inputs;
for(int i = 0; i < 5; ++i)
{
cout << "Enter an integer: ";
cin >> inputs[i];
}
for(int i = 0; i < 5; ++i)
{
cout<< inputs[i];
}
}
Like that?
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
|