1.] Define a variable to hold a number, initialize it to 0.
2.] Define a char variable to hold the character 'X'.
3.] Ask the user how many times he or she wishes the character to be output
4.] cin >> ...;
5.] Write your while loop and ask yourself which condition to use.
Hint: As long as number > 0 execute this loop
6.] Next, inside the loop, write a statement that outputs the character that many times.
7.] cout << ... ;
Edit: The above is an example how to break down the problem. The way to solve such problems is by taking these steps. (Before writing code)
Ask yourself, what should the program do?
Which variables do I need and what kind, int, char, double, float ...?
Do I wish the user to input something? What is it?
Which functions, loops, etc. do I need to write?
What is there condition?
What goes where?
Which output should I expect?
If you know this, and still you are not sure how to solve it, choose that part of the problem you know how to solve. Start with the variables, and work your way down the list.
Try different ways of writing your code to simply produce output, for instance, or to test input.
That should help you find a way to 'attack' the problem, and write code that does what you want it to do.