patter like
n=2

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

pls help me in solve this program

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");
	}
}
commented: Then you should read the forum rules about not spoon-feeding answers to people who show no effort -3
commented: good job dude +0

generlize this above program for n number

commented: *cough* -1
commented: See Salem's post +0
commented: You generalise it you lazy ass -3

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()