-4

patter like
n=2

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

pls help me in solve this program

Edited by meghs007: n/a

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by xavier666
0

I am new here ,here is my code:

#include "stdio.h"
main()
{
	int i, j;
	for(i= 0; i<4; i++)	
	{
		for(int k= 6-2*i; k>0; k--)
		{
			printf(" ");
		}
		for(j= i+1; j>0; j--)
			printf("*   ");
		printf("\n");
	}
	
	for(i= 3; i>0; i--)	
	{
		for(int k= 8-2*i; k>0; k--)
			printf(" ");
		for(j= i; j>0; j--)
			printf("*   ");
		printf("\n");
	}
}

Edited by lostfate: n/a

Votes + Comments
Then you should read the forum rules about not spoon-feeding answers to people who show no effort
good job dude
0

First of all meghs, your pattern is not properly indented, it should be

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

Second, you should have shown us how much you have tried. Let your code be full of errors, we'll point out your errors. But don't expect fully fledged answers for you to copy-paste. It is against the spirit of learning

Third, lostfate, you shouldn't have given out the answer just like that. Help him/her to understand the nature of the problem. At least someones brain neurons would have been tickled.

Forth, lostfate, please follow the standard coding practices, that is, int main() (with return ) and not just main()

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.