Well, it's pretty freaking easy when you don't have to calculate the binomial coefficients. Just two trivial loops if you don't want leading whitespace and three if you do.

>i want code for this.
Then you'd better get started on writing it.

>pls giv me the code
No. And saying "please" isn't going to help because we don't give freebies to cheaters like you. Do it yourself and if you have a real question, we'll help answer it.

#include<iostream.h>
#include<conio.h>
void main()
{
int i,j,n;
cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
cout<<"*";
}
}
getch();
}

Edited 6 Years Ago by WaltP: Added CODE tags -- with all the help about them, how could you miss using them????

Comments
Fail (on multiple levels).

it does rather depend what language u r using.
but it is a simple loop job where each time you go round the loop (until it exits in this case at five) you just increase the counter by +1 and then print out the '*' multiplied by the counter.

over to u
M

>it does rather depend what language u r using.
I could be wrong, but since this thread is in the C forum, it'd say C is pretty freaking likely to be the language he's using.

>over to u
Don't waste your time. By now this leech has already gotten a failing grade on the homework, and we'll never see him again.

Edited 6 Years Ago by Narue: n/a

sorry I did n't see (c!) the c forum but I agree there is only one way to program ...do it. I think this thread could be closed!
M

This article has been dead for over six months. Start a new discussion instead.