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;
}
#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;
}
nice bro
ReplyDelete