| hunterb24 (20) | |||
This should print out * * * * * * it should print out one row for how many ever the user inputs. What is wrong? | |||
|
Last edited on
|
|||
| SwatSid (19) | ||||
hi hunterb24! actually u shud have the for loop like this...
if u include the above loop, with changes ofcourse according to ur program, u wud get this O/P(depends upon value of n according to my program. the below O/p is for n=4):
| ||||
|
Last edited on
|
||||
| SwatSid (19) | |||||
hey man... first take out that
u can do changes and modify to ur use! | |||||
|
Last edited on
|
|||||
| hunterb24 (20) | |
|
how can i align the whole triangle to the center to create an equilateral triangle? such as : * * * * * * * * * except centered | |
|
Last edited on
|
|
| hunterb24 (20) | |||
i am trying to take this slow and go from an easy program to a slightly more difficult one, as my final product will be:
which needs to be centered too with as many rows as the user specifies. Thanks so much for your all your help. | |||
|
Last edited on
|
|||
| SwatSid (19) | |||
ok so u want it to be centers right? its actually very simple... i expect u wud know about the setw() function. no big changes to our program, just one line to be added to make it centred! first #include <iomanip.h>. actually i insist u not to use THREE for loops for this pattern printing... leads to a lot of confusion... so just try to chnge ur program like how i posted, the very first post of mine... have the control variables in terms of i and j... that reduces time of typing the variable names and doesnt have any special characters or confusion between uppercase or lowercase(hope u understood what i blabbered here :P )... well am gonna post my code, try changing the control variables to ur program or BETTER u follow the method i do cause its a lot more easier than ur way of thinking. its too simple just add very little things...
the bold highlighted ones are the little changes to be added so as to print the pattern like a equi-triangle... *
*** ***** ******* | |||
|
Last edited on
|
|||