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=1; j<=i; 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. If you want all explanation of this code then type your comment, I will give you.
USING FOR LOOP THE CODE TO DISPLAY THE PATTERN OF HALF PYRAMID
Reviewed by Amit Waghmare
on
September 22, 2018
Rating:
No comments: