C
coinjo
I need to write a program, which takes two inputs:
â€¢ï€ ï€ a value n that represents the number of elements in the
longest row of a triangle.
â€¢ï€ ï€ a character c to be printed in place of each element.
Your algorithm should produce an isosceles triangle of characters c.
For example,
for n=7 and c=’$’, the resulting triangle should be as follows:
$
$$$
$$$$$
$$$$$$$
Any hints please? It should only work for odd values of n.
â€¢ï€ ï€ a value n that represents the number of elements in the
longest row of a triangle.
â€¢ï€ ï€ a character c to be printed in place of each element.
Your algorithm should produce an isosceles triangle of characters c.
For example,
for n=7 and c=’$’, the resulting triangle should be as follows:
$
$$$
$$$$$
$$$$$$$
Any hints please? It should only work for odd values of n.