skip to main
|
skip to sidebar
C PROGRAMS
By sudheer
Friday, October 12, 2012
FLOYD'S TRIANGLE
FLOYD'S TRIANGLE
# include <stdio.h>
# include <conio.h>
void main ()
{
int i , j , k=1 , rows ;
clrscr () ;
printf ("How many rows : ");
scanf ("%d",&rows);
printf ("\n\n\n");
for (i = 0 ; i < rows ; i++) {
for (j = 0 ; j<=i ; j++) {
printf ("%5d",k);
k++; }
printf ("\n") ; }
getch ();
}
OUTPUT:
Wednesday, October 10, 2012
Image of Right Angled Triangle
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:
Pages
Image of Right Angled Triangle
FLOYD'S TRIANGLE
Home
Blog Archive
▼
2012
(2)
▼
October
(2)
FLOYD'S TRIANGLE
Image of Right Angled Triangle
Labels
c programs
(1)
FLOYD'S TRIANGLE
(1)
triangle using c
(1)