034. Write a program to print following outputs in C language

* * * * * *
* * * * * *
* * * * * *
* * * * * *
* * * * * *
#include<stdio.h>
#include<conio.h>
main()
{
	int i,j,n;
	clrscr();
	printf("Enter number : ");
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=n;j++)
			{
			 printf("*");
			}
		printf("\n");
	}
	getch();
}

7 thoughts on “034. Write a program to print following outputs in C language

    1. practice ! practice !! practice !!!
      All you need to do is practice these 101 programs, its the core that is necessary to build programming logic/skill.
      Practice may become boring over time, so better share these things with your friends so that you can discuss, code together and hence it can become fun!

  1. hi, i hav started to learn pgmg . can i j jus knw why j variable is used here. is it only for nxt line. ?? wil i an j act simultaneously for displaying asterisk.

Leave a Reply

Your email address will not be published. Required fields are marked *