The Matriculation school have arranged an Annual Day Function.Volunteers have decorated a floor on various places of the school using Rose and Tulip flowers. But one of the coordinators requested the volunteers to rearrange the decoration like a triangular size.Coordinator also told them that tulips flowers need to be positioned at the middle of the roses

 #include <stdio.h>

int main()

{int rows;

scanf("%d",&rows);

for(int i=1;i<=rows;i++){

    for(int j=1;j<=i;j++){

        if(i==rows||i==j||j==1) printf("1 ");

        else printf("0 ");

    }printf("\n");

}

return 0;

}

Comments