I need to write a program that inputs from the user a positive integer, say n, and any character, say c, and outputs to a file called "ass2.run" a solid isosceles triangle constructed with the character c, with its sides of size n and its right angle at the lower right corner. For example, if the inputs were 6 and the character "*" , the output file woulf look like:
Triangle: n=6, character =*
*
**
***
****
*****
******
He gaves us a hint, for each line, output the needed number of blanks and then the needed number of characters. use a two for loops(one for the blanks and one for the charater) inside another for loop.
Basically he wants a
For
[
For
[
For
Loop
He also taught us how to output the file using infile ; and outfile ; commands. Please keep the language simple as possible. Thanks for the help



LinkBack URL
About LinkBacks


