August 6th, 2003, 12:03 AM
please help me!!
Please help me..
I have to create a program that will input a number and then print them in a triangle pattern. Eg: If the number 5 was inputted then the output would be:
I got the program half working. It prints the first column of numbers but that is it. I know i have to use a for loop but i have no idea how. The program so far is as follows:
int count = 1;
printf("Please enter the number:\n");
count = count + 1;
while ( count < number );
August 6th, 2003, 08:15 AM
1) Your subject title is unacceptable. You can refer to the sticky thread at the top of this forum for more information on how to post a question.
2) Do not post questions to help solve homework problems. Go to your instuctor and/or peers for help on homework.
August 6th, 2003, 09:47 AM
1). Regarding the subject line, I didn't know there was a format on the posts.
2). I am not posting questions to take an easy way out of solving "homework" problems, i have exhausted all other means of solving this problem and hence is why i made a post.
3). Time is very limited when it comes to asking instructors for help regarding all questions
4). I would not have made a post asking strangers for help if one of my friends could have helped me.
August 6th, 2003, 11:51 AM
Your format is the reason why I stated that you need to read the stick thread at the top of this forum. It gives you the info that you need to know.
Comming here asking for help on homework will always get you trouble in these forums because it is highly discouraged.
This is more for your protection then anything else. Most of the code that could be written for this would not look like a beginners program and is typically apparant to instructors. To get you started though try following this logic:
- get a number from the user (c (fgets/scanf) c++ (cin))
- loop this number of times (for () )
-- loop to display a line (for () )
--- build a line
--- next inner loop
-- display the built line
- next outer loop
August 6th, 2003, 08:15 PM
Thank you sincerely Joe, with the help you gave me I got the program working