Cout horizontally | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Cout horizontally

How solve this code and how print these words horizontally https://code.sololearn.com/c681DnBPFIdj/?ref=app https://code.sololearn.com/c681DnBPFIdj/?ref=app

1st Apr 2019, 2:03 PM
Amir
Amir - avatar
1 Answer
+ 2
goto f; This is very bad practice. It is forcing your program into an endless cycle. Forget about goto, use for loops and function calls instead. You already have 'for' loop in your program that should be enough. You should understand that once you have printed a line to the console, there is no going back to previous lines. Each letter spans multiple lines. So to put the letters next to each other, you would have to print the letters simultaneously, always just one line at a time that contains parts from multiple letters. The best way to do it, is to store each letter in an array that contains the lines of the letter. Then do a for loop over 6 lines, another nested loop over the letters, and print the line associated with the letter. I hope it was clear enough, I guess that would be a completely different program because it needs total redesign. Try it with 2 letters first... If it works you define the rest.
4th Apr 2019, 4:11 AM
Tibor Santa
Tibor Santa - avatar