Print Nepal Flag in C language

 #include<stdio.h>

void triangleshape(int n);

void flagpole(int n);

int main()

{

int row;

printf("Enter number of rows:");

scanf("%d",&row);

triangleshape(row);

triangleshape(row);

flagpole(row);

return 0;

}

void triangleshape(int n)

{

int i,j;

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

{

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

{

printf("*");

}

printf("\n");

}

}

void flagpole(int n)

{

int i;

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

{

printf("*\n");

}


Post a Comment (0)
Previous Post Next Post