0 like 0 dislike
15.2k views

Print this pattern

Input

5

Output

    1
   121
  12321
 1234321
123454321

Input

8

Output

       1
      121
     12321
    1234321
   123454321
  12345654321
 1234567654321
123456787654321

 

[Exercise] Coding (C) - asked in Chapter 6: Loops by (12.1k points)
ID: 31132 - Available when: Unlimited - Due to: Unlimited

edited by | 15.2k views

58 Answers

0 like 0 dislike
Hidden content!
#include<stdio.h>

int main(void)
{
    int i,j,n,k;
    scanf("%d",&n);

    for(i=1;i<=n;i++)
        {
* * ** *** * * * * * * ** ** * ** * * ** ** *** ** * * * * *** *** * **
            printf(" ");

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

        }


return 0;
}
answered by (-249 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main()
{
* * * ** * *** * * m = 0;

**** * ** *** ** * n = 1;

* * ** ***** * * *** ** *** ** *** * &m);

    int column = m;

* *** **** **** i, j , k, f;

* **** * *** ** * * = 1; i <= column; i++)
    {
** * ***** *** * * ** *** ** * * * * * * = 1; j < m; j++)
* *** ** ** **** *** ** * * * * * * *
* * * ** * ** **** ** * * *** * *** ***** ** *** * ** ** ** *** ");
* * ** ** * *** * * ** * * * * * **** *********

** * *** **** ** ** ** ** ** * *** * * * * *** * = 1; k <= n; k++)
** * * * ******* *** ** **** ** *** ** *
* * **** * ** *** * * **** *** * ** * **** * ** * * ** * * * ** k);
** * ** ***** ** * * ** * * *** ***** * *

* * *** *** *** * * ** * * ** * * * *** * * * = n; f > 1; f--)
** ** * **** * *** * ***** *** * *
**** ** ** *** * ***** * * *** ***** **** * *** * *** * ** * *** *** ** ***** *** ** ** f - 1);
*** ** * **** * ** **** ** * * ** * *
** * ***** * * * ***** *** * ** ** * * *
** * ** * * * ** * * * * ** ** ***** ** * **** i < column )
* * ** * * ** * **** **** ** *** ***** ** * * ** * ** ***

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

** * *** * ** * *** *** * * * ** *****
    }
}
answered by (-285 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include<stdio.h>

int main(void)
{
    int i,j,n,k;
    scanf("%d",&n);

    for(i=1;i<=n;i++)
        {
** ** *** * ** * * * ** *** * ** * *** * * **** *** ***** **** ***
            printf(" ");

* * ** ** * * ** * * ** * ** * *** * * ** * ** **** ** * ****** *** * ***
* * ***** * *** * ** * *** * * * * * ** * **** * ** ****** *** ****** ****
* ** * * ** ***** ** ** * ** ******** * **** ** * * *** * * * * *** * * * * ****** * *** * * ******* ** * * * ** * *** ***
* * * *** ** * *** **** ** ** ** **** ** ** ** ** ** **** *** ** * * * * *
** * ** ***** *** ** * ** ** ** *** * ** *** * **** ** *** ** **** * ** ** * *** ** * *
* ** ** ** ** ** **** * *** * ** ** * ***** ** *** * ***** **** * * ** *** * ** ** ******* * *** *
* * ** * * * * * ** ***** ** ** ** ** ** **** **** ********* ***** * * ****** * * **** * * * * ** * ** ** * * *** *** ****** ** ** **** **** * ***
*** * **** ** * * ****** ** * ** ** * ** * ** ******** *** * ** * **** **** *** **** * * * ** ****** * * * * ** * * * * * ** * * * * *** *
* * * * **** ** * *** * ** ** * ** * *** * * ** * *** ** * ** ** * **** * **** * ** ** ** ** * **** * * * ** ** ** ** **** ** * *** * * * ** * * * ** * * ** * * **
* * * * ***** * * ** ** * * * * * * * ** * * ** * ***** *** * * * ** * * * *** *** *** * ** **** * * ** * * ** * * * * ** ** *** * *
* * * ** * * ** * *** * * * *** * * * * * * *** ***** **** **** * * ***** ** ** *
***** *** * * * ** *** ** * * ****** * ** * * ** * ** * **** ** * ** * * *** ** * ********** * * * *** *** ***** ** *** **** ***
        }


return 0;
}
answered by (-249 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
answered by (-336 points)
0 0
prog.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
 gg
 ^~
0 like 0 dislike
Hidden content!
*
answered by (-336 points)
0 0
prog.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
 gg
 ^~
0 like 0 dislike
Hidden content!
* ** * *** **
int b,a,i,j;

int main()
{
**** * * ** * * **** *


** ******** *
{

* *** ** * * * ** * *
* ** ** *** * ");

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

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

}
}
answered by (-336 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
* * ***** ***** * **
int b,a,i,j;

int main()
{
** * * *** *** * * *


*** ** *** **
{

** * * * * ** * * * ** *
**** ***** ** * *** ");

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

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

** *** * * * * *********
}



}
answered by (-336 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main()

{
int i,j,k,l,n;
** * **** * **********
for(i=1;i<=n;i++)
{
*** * * * * * * *********
** ***** * ****
***** *** ** ** ***** ** * *** ** * * ** * ** ");
** ** **** ** * ** *
* * ** ** * ** * ****
*** *** ** ***** **** **
* ***** **** * * *** ** * *** **** ** * ** ** *** ** * **
* * * **** *** ** * *
************ *** * ** * **** * ** *** *
* ** * * **
** ** *** **** *** * * * ** * ** * * ** **** * ***** * * *** * *
    }
* ** * * * * * ** *** (i!=n)
* ** * * * * ** ** * ** * ** * **
}
}
answered by (-255 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main()

{
int i,j,k,l,n;
* *** * * * ** ***
for(i=1;i<=n;i++)
{
* * * **** ** * * ** * * ** **
*** * **** * ** *
*** ** * * * * * * ****** ** * * * * ** * ** * * ** ** * ");
* * * ** ** ** ** *
* ** * *** *** ***** * * ***
* *** * * * *** ** *
*** * * * **** ** * * ** * * * *** *** * **** * * * *
***** ** * ** ** ** *
*** *** * ** * ** ** **
* * * ** *
** * ** * ** * **** * ** *** * * ** * *** *** * * ** *
    }
** * ** * * * *** ** **** * (i!=n)
*** * ** ** ** *** ** ** * * * * * ***
}
}
answered by (-127 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,i,space;
    int j=1;
** ** *** **** * ** * ** *** * * ***
* **** * ***** * * **** ** * *** *
    {
** * ** * ** * * * * * ** ** * * * *** * ** ****** * * ** * ***
* * * ** * * *** *** ** * * *** * *** *****
* * ***** ** ******** * ** * * * * * * *** *** *** ** * **** * * ** * * * * ** ");
*** *** ** *** * *** * **** * * ******** ***** * **
* * ** * * * * * * ** ** * * * * * ** ** * *** * ** * * * *** *
* ** * * *** **** ** **** ** * ** *** ***** * * *** ** *
*** * * ** ** *** * **** * **** ***** * * * * * ** * * * ** ** * *** *** ** **
****** ** *** *********** * * ** *** *
* *** *** ** * ** *** ********** * ** ** ** ** * * * * *** * *** ***
* ** *** *** **** *** * * ** * **** * ******** *
* * *** * *** * * ******** *** * * *** ******* * ** ** ** * * *
*** * * * * ** ** ** * * * ** *** * ** * *
* * * *** ***** ****** * * * ***
** * **** ** * * ***** *** *** * * * *
    }
    return 0;
}
answered by (-258 points)
0 0
Case 0: Correct output
Case 1: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:104.23.243.109
©2016-2026

No related questions found

12,783 questions
183,442 answers
172,219 comments
4,824 users