Hello VinCenT98,
PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
http://www.cplusplus.com/articles/z13hAqkS/
Hint: You can edit your post, highlight your code and press the <> formatting button.
You can use the preview button at the bottom to see how it looks.
The first thing I notice is the first line in the for loop. "rand" returns an "int" which you ate trying to store in a "char". Not likely to give you the result that you want. Yo should consult an ASCII table to see where what you want resides. And if they are not all together this will be a problem. The "%54" will put you in the middle of the numbers 0 - 9 and when you add 35 this is near the end of the capital letters.
An alternative to what you want to do is define a std::string and initialize it to the characters that you want.Such as
std::string symbleChars{ "#$XO" };
. Then generate a random number between 0 and the length of the string. Use that number as a subscript to get a character from the string.
I think this would be easier than what you are trying to do.
Try to avoid using variable names like "a". I realize that typing one letter is easy, but use something more descriptive for what it is used for or does. At sometime in the future you will look at this program and spend about half of your time just trying to figure out what the single letter variables are for. Been there done that, just today actually, not much fun.
Looking more at the for loop i realize it would be an endless loop except for the break statement which will only let the for loop execute only one time,so the endless loop has no real meaning.
Sorry it is the inner for loop that has the problems. the outer for loop is OK. Not easy to read your code as it is.
Hope that helps,
Andy