USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF DOWNWARD HALF PYRAMID



USING FOR LOOP THE CODE TO DISPLAY THE PATTERN:

#include<stdio.h>
#include<conio.h>
int main()
{int i, j, n;
printf ("ENTER THE NUMBER TO DISPLAY PATTERN ");
scanf ("%d",&n);
for(i=1; i<=n; i++)
{for(j=i; j<=n; j++)
{printf("♥ ");
}
printf("\n");
}
getch();
}

OUTPUT:
When inputted is 5
♥ ♥ ♥ ♥ ♥
♥ ♥ ♥ ♥
♥ ♥ ♥
♥ ♥

In this code I'm using the ♥ sign you will use any sign. If you have any difficulty the write in the comment box. Friends in the next blog I will teach different patterns.




USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF DOWNWARD HALF PYRAMID USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF DOWNWARD HALF PYRAMID Reviewed by Amit Waghmare on September 22, 2018 Rating: 5

No comments: