Menus

Saturday 17 April 2021

Printing Pattern in C


Output



Source Code

 

#include<stdio.h>

void main()

{

int i,j,k,rows=7;

clrscr();

  for(i=1;i<=rows;i++)

  {

   //print blank space

   for(j=1;j<=rows;j++)

   {

     if((i+j)<=rows)

       printf(" ");

     else

       printf("*");

   }

   printf("\n");

  }

  getch();

}


Video




No comments:

Post a Comment