C Programming Tutorial

 
 
 
 

Image

#include <stdio.h>
#include <conio.h>

void main(){
    int i,j,num,c=1;
    clrscr();
    printf(\"*****FLOYD\'S TRIANGLE*****\\n\\n\");
    printf(\"Enter number upto which u want to generate : \");
    scanf(\"%d\",&num);
    for(i=c;i<=num;i++){
    for(j=1;j<=i;j++,c++){
       printf(\"%5d\",c);
       if(c==num)
          goto out;
       }
       printf(\"\\n\");
    }
    out:
getch();
}

 
 
Didn't find what you were looking for? Find more on Program that displays floyds triangle of numbers