Image of Right Angled Triangle
#include<stdio.h>
#include<conio.h>
void main(){int i , j , k , n , sp ;
c l r s c r ();
printf ("\n How many rows? : ") ;
scanf (" %d " , & sp);
n = sp;
for (i = 1 ; i < = sp ; i++)
{
for ( j = 1 ; j <= n ; j + +) {
printf (" ") ; // To print spaces }
for ( k = 1 ; k < =i ; k ++ ) {
printf ("*" ) ; }
printf ( " \ n ") ;
l - - ;
}
getch () ;
}
OUTPUT:
0 comments:
Post a Comment