1,105,546 Community Members

Print an isosceles triangle

Member Avatar
maynardjk13
Newbie Poster
16 posts since Nov 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Greetings!

I have an assignment for my CSE class that requires me to write a program that prints out an isosceles triange made of asterisks. The program reads in the number of rows from the user and prints out a triangle with that amount of rows. The following functions were given to us: Print(NumRows-irow) blanks; Print (2*irow-1) characters '*'; Would I be right in assuming that the easiest way to do this is to define two functions? That is, one to print out spaces and one to print out asterisks?

Member Avatar
WaltP
Posting Sage w/ dash of thyme
9,363 posts since May 2006
Reputation Points: 2,905 [?]
Q&As Helped to Solve: 1,151 [?]
Skill Endorsements: 45 [?]
Team Colleague
 
0
 

Not necessarily easiest, but it would work just fine.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: