Loop with how many x's

Hey guess, trying to create a program that asks for how many X's in an input, then displays that many in the output. Here's what I have so far, would I need the count function for this? The instructions say I need a loop.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <string>

using namespace std;

int main ()
{
	int numExs;

	cout << "Please enter the numbet of Xs (1-10): " ;
	cin >> numExs;

	if ((numExs > 0) && (numExs < 10))
	   // this is where i have to print how many x's they input

	else 
	cout << "Entry is out of range."
}

Oh, the instructions say to use a "for loop"
No, just use a for loop like they state.
I take it you know how to take it from here?

Also, you may want to check your bounds- the if statement you currently have implemented doesn't allow the input to equal 10.
Topic archived. No new replies allowed.