input and output

i know the basic input and output process. I cant figure out how to output the letter " Y " based a numbers the user inputs. for example user inputs 3 , so that would output " YYY " or 6 would output " YYYYYY"
.I would be great full if i can get any help. Thanks
You should look into loops, specifically for loops. in this case I would do something like this:

1
2
3
4
5
6
7
8
int userinput = 0;
cout << // tell them to enter a number;
cin >> // take their input and put it into userinput
char outputchar = '^'; // change outputchar to whatever you want to output multiple times

for (int temp_int = 1; temp_int <= userinput; temp_int++){
cout << outputchar
}
Topic archived. No new replies allowed.