Monday, October 5, 2020

C Language Pattern Code

 Code :-


#include <stdio.h>
int main()
{
int i, j, n, k = 0;
scanf(“%d”,&n);

for(i = 1; i <= n; ++i, k = 0)
{
for(j = 1; j <= n – i; ++j)
{
printf(” “);
}

while(k != 2 * i-1)
{
printf(“* “);
++k;
}

printf(“\n”);
}

return 0;
}

    Choose :
  • OR
  • To comment
No comments:
Write Comments