*\n **\n ***\n ****\n***** use the c programming

0 votes
asked Jul 2 by Sabyasachi Naskar
reshown Jul 2

   

*
**
***
****
*****

use the c programming

5 Answers

0 votes
answered Jul 6 by anonymous
#inlcude<stdio.h>

void main()

{

for(i=0;i<5,i++)

{

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

{

printf("*");

}

printf("/n");

}|

}
0 votes
answered Jul 6 by (140 points)
#inlcude<stdio.h>

void main()

{

int i,j;

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

{

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

{

printf("*");

}

printf("/n");

}
0 votes
answered Nov 6 by CRS
#include <stdio.h>

void main()
{
    char a[5][5];
    for(int i=0;i<5;i++)
    {
      for(int j=0;j<5;j++)
        {
          if(i+j<4)
            a[i][j]=' ';
          else
            a[i][j]='*';
        }  
    }    
  for(int i=0;i<=5;i++)
    {
      for(int j=0;j<5;j++)
        printf("%c",a[i][j]);
      printf("\n");    
      
    }    
    
}
0 votes
answered Nov 7 by Sabyasachi Naskar
#include<stdio.h>
int main(){
int i,j,k;
for(i=1;i<=5;i++){
for(j=4;j>=i;j--){
printf(" ");
}
for(k=1;k<=i;k++){
printf("*");
}
printf("\n");
}
}
0 votes
answered Nov 8 by (660 points)
edited Nov 8 by
/*i think i saw all the answers but all are used more than 2 loops i used only 2 loops once try it*/

#include<stdio.h>

void main()

{
    int i,j;

for(i=4;i>=0;i--)

{

for(j=0;j<=4;j++)

{
if(j>=i)
printf("*");
else
printf(" ");

}

printf("\n");

}

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...