How to print triangle in C

#include<stdio.h>
int main ()
{
int i=5,j;
for (i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
printf(“O”);
printf(“\n”);

}

}

OutputofProgram-

Leave a Reply