TRIANGLE USING LOOP AND IF CONDTIONS IN C NESTE LOOP

   

#include <stdio.h>


int main()

{

    int i,j,l=9,p=5,q=5;

    for(i=1;i<=l;i++)

    {

        for(j=1;j<=l;j++)

        (i==5||j==p||j==q)?printf("*"):printf(" ");

        p++,q--;

     printf("\n");   

    }


    return 0;

}


Comments

Post a Comment

Popular posts from this blog

250+ C Programs for Practice

FUNCTION OVERRIDING IN CPP