We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,188 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Print an isosceles triangle

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?

2
Contributors
1
Reply
5 Minutes
Discussion Span
1 Year Ago
Last Updated
3
Views
maynardjk13
Newbie Poster
16 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Not necessarily easiest, but it would work just fine.

WaltP
Posting Sage w/ dash of thyme
Team Colleague
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.2947 seconds using 2.69MB