Computer Science, asked by Anonymous, 6 months ago

12. Write a program to produce following output.
*
* *
* * *
* * * *
* * * * *​

Answers

Answered by riyaamen303
6

Answer:

#include <stdio.h>

int main() {

  int i, j, rows;

  printf("Enter the number of rows: ");

  scanf("%d", &rows);

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

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

        printf("* ");

     }

     printf("\n");

  }

  return 0;

}

Hope this helps you.Please add as Brainliest if it is correct.

Answered by sweetyyyy90
3

include<stdio.h>

#include<conio.h>

int main()

{

int i, j, k,sp;

//print 7th row

for(i=0;i<=6;i++)

{

for(j=65;j<=71-i;j++) //loop for first half

{

printf("%c",j);

}

//add space between these string

for(sp=1;sp<=i*2-1;sp++)

printf(" ");

for(k=71-i;k>=65;k--) //loop for next half (Second half)

{

if(k==71);

else

printf("%c", k);

}

printf("\n");

}

}

Similar questions