.
Previous Next

Write a C program which prints triangle format?


/* C program which prints triangle format */
#include<stdio.h>
#include<conio.h>
int main(){
       int i,j,rows = 10; /* give input here*/
       clrscr();
       for (i = 0; i < rows; i++) {
     for (j = 1; j <= i; j++) {
         printf("*  ");
    }
 printf("\n");
    }
    getch();
    return 0;
}

Previous Next