C Programming Tutorial

 
 
 
 

Image

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

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

 
 
Didn't find what you were looking for? Find more on Program to display floyds triangle