does anyone know how todisplay the following using a for loop in my program

question:if n=5 where n is the ht of the pattern

*********
****   ****
***        ***
**             **
*                 *

if n=4

*******
***   ***
**       **
*           *

SOLUTION I TRIED OUT IS

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{printf("*");
}
printf("\n");
}
getch();
}

pls suggest modifications if anyone knows how to display the correct solution.

Salem commented: No code tags, more cookies! -7
mvmalderen commented: 48 Posts, no code tags, void main(), answer to your question: yes I know how to do that. -3
Nick Evan commented: [URL="http://www.daniweb.com/forums/misc-explaincode.html"]code tags.[/URL] -4

does anyone know how todisplay the following using a for loop in my program

question:if n=5 where n is the ht of the pattern
*********
**** ****
*** ***
** **
* *
if n=4
*******
*** ***
** **
* *

SOLUTION I TRIED OUT IS
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{printf("*");
}
printf("\n");
}
getch();
}
pls suggest modifications if anyone knows how to display the correct solution.

Analyze the the thing
find out the logic and
make a dry/manual run of your code....!!!

HINT: concentrate on the change of the loop variables i and j!!

commented: what??? your comment isn't even meaningful. and why do you feel the need to repost all his crappy, unformatted code. it was bad enough seeing it the first time -3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.