PROGRAM TO PRINT A TRIANGLE OF STARS

No comments
/*PROGRAM TO PRINT A TRIANGLE OF STARS*/


#include<stdio.h>
intmain()
{
inti, space, rows, k=0;
printf("Enter number of rows: ");
scanf("%d",&rows);
for(i=1;i<=rows;++i, k=0)
{
for(space=1; space<=rows-i;++space)
{
printf("  ");
}
while(k !=2*i-1)
{
printf("* ");
++k;
}
printf("\n");
}
return0;
}


OUTPUT :-



No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀