Program to Print this Right angled Pyramid in C using Nested Loops in C

January 7, 2025 No Comments » Hits : 30







Program : Print this Right angled Pyramid in C using Nested Loops



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

Related Articles:

Leave A Response