Attempting a code that I think is very simple and I'm just having some trouble figuring it out. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Attempting a code that I think is very simple and I'm just having some trouble figuring it out.

I'm trying to make a Alphanumeric number generator based off the c++ password generator code made by solo learn. (ex. of a successful out put. "H3ID7-PNA8L-YNWQ9-7VTS7-NAM67") I know you can change the output from that password generator to have it only display capital letters and numbers and have the length be 25 characters but that doesn't help because I can't have it auto put the hyphen between every 5 characters because it's a for loop.

5th Nov 2016, 5:02 PM
Zaldimmar
Zaldimmar - avatar
2 Answers
+ 3
for (int i = 1; i <= 29; i++) { if (i % 6 == 0) { std::cout << "-"; continue; } cout << "#"; }
6th Nov 2016, 6:28 AM
Cohen Creber
Cohen Creber - avatar
+ 1
worked out well thanks I'm still a beginner in c++ so I'm just trying to figure these things out.
6th Nov 2016, 7:18 AM
Zaldimmar
Zaldimmar - avatar