Hi!
I Want this output by for loop here i wrote it programme but there is little
error it it
Output
_______________________________________________________________
Enter Number:9
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
___________________________________________________________
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,n;
printf(Enter Number Odd:");
scanf("%d",&n);
for(i=1;i<=n;n+2)
{
for(j=1;j<=n-1;j++)
printf(" ");
for(k=1;k<=i;k++)
{
printf("*\t);
}
}
}
getch();
__________________________________
or Like this
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,k,m,count;
count=1;
printf("Enter:");
scanf("%d",&m);
for(i=1;i<=m;i++)
{
for(i=1;i<=1;i++)
{
for(j=1;j<=m-1;j++)
{
printf(" ");
for(k=1;k<=count;k++)
{
printf("*");
count=count+2;
printf("\n");
m--;
}
}
}
}
getch();
}
___________________
GLOGIC 20 <[EMAIL PROTECTED]> wrote:
Hey
im new myself but id imagine something simple like this should do it
for (int i = 1;i < 9 ; i = i+2)
{
for (int j = 0; j < i; j++)
{
cout << "*";
}
cout << endl;
}
if i understood what ur looking for that is.. not sure why there would be a
3rd for loop but this should get u started
>From: Pradip
>Reply-To: [email protected]
>To: [email protected]
>Subject: [c-prog] triangle By for loop
>Date: Sun, 11 Mar 2007 11:30:46 +0000 (GMT)
>
>hello Friends!
>
>I am new in C Programming & i have to make programme for triangle
>by: FOR Loop;
>
> *
> * * *
> * * * * *
> * * * * * *
>
>there is 3 For Loop.
>
>Hope You Will Help Me
>Waiting For Your Replay
>
>Bye.
>
>
>
>
>---------------------------------
---------------------------------
Heres a new way to find what you're looking for - Yahoo! Answers
[Non-text portions of this message have been removed]