0
Printing number patterns in c
User inputs two numbers, I need to find their sum (which will be two-digit number at most) and then print those two digits using stars. For example: Input: 8 7 Output: * ***** * * * ***** * * * ***** I thought I could do it like this: -for loop which will run twice (once for each digit) -in this for loop I wrote how each of the 10 digits should be printed -in the first run I print first digit, then in second the second digit But it prints my digits one under another. How do I make it print digits next to each other?
3 Respuestas
+ 1
You need to print the whole line:
* *****
If you are in the second line you can't jump back to the first line.
0
Denise Roßberg Yep, I know that. But I don't know how to do a combo of two digits (since there are 100 possible outputs) any other way.
0
Make all digits pattern 0 to 9, and use switch case to print for individuals...