0 like 0 dislike
15.3k 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.3k views

58 Answers

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

int main(){
    int a;
    int i,j;
** ** * * ** * * *** *** * * * ** ** * * ***** **
* ** * * ** ** **** ** *
** * ** * * * ** * ** * ** ** * * **** *** * * * * ** * * *
** *** ** * ** * ****** * * ** *** ** **** ** ** * ** * * ** * * *** *** * ** ");
*** * * *** * * ** ***** ** * ** ***** ***

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

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

int main(){
    int a;
    int i,j;
*** * * **** ** *** **** * * ** ** *
* **** * **** * * ** **
* * * **** * * * *** ** * ** * * * * **** ** * **
*** * ** **** ** * * * ***** **** * * * ******* * ******** ** *** ** * * * * ");
***** * ** * * * *** **** * * **** ** * *

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

* ** ****** * ** ** * ** ** ** ** *** * ** * ** * * * **
** ** * *** *** * * * ** *** ** **** **** * ****** *** ** ** * ** ** * * ****
* * ** ** ** * ** ** ***** *** *** * ** *
* *** ** * ** * ** ** **** * ** * *** ** * * * * ** ***** \n");
    }
    return 0;
}
answered by (-116 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include<stdio.h>

int main(){
    int a;
    int i,j;
* ** * ** * *** **** * * **** * * *** * * **
** * *** ** * *** * * * * ****
** ** ** **** ** * * * ** **** * *** ** * * * * ** ** * *
* *** * ** * ** ** ** * * * ** * * ***** * * * *** ** * ***** ** ");
** ** ** * *** *** * ** ** * * **

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

** * ** **** ** * * *** *** **** ***** *** * * * *** *
* * * ** *** * ** * ** ** * ******* ** * * ** * ** ******* * ****** *** ****** ** ** * * * *
* **** ** * * * * **** * * *** * ***** *
** * * * * *** **** * * * *** ** * * *** * * * * *
    }
    return 0;
}
answered by (-116 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include **** * * **
#include * ** ** ** * * **

int main()

{
int
*** * * ** * **
* * ** ** * **
{
* ** ** **** **
{
* * ** * * *
}
** * * ** * * ****
{
** *** * * *
}
** ** * * ****
{
* *** * * * * * * **
}
****** * * * * **
}
}
answered by (-127 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include * * * ***
* * * ** *

int main()

{
int * * *
*** ** ** * ** * *
* *** ** ** *
{
* * * **
{
******* * * * * *
}
* * * **
{
*** * * **
}
*** *** *** **
{
** ** * *** **** * ** *
}
}
}
answered by (-127 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include * ** ** *
#include ** ** **

int main()

{
int ***
** ** * ** *** * *
*** * ** * *
{
** **** ** *
{
*** * * * ** *
}
*** ***** *
{
***** ** * **
}
**** * ** * *** * **
{
* * * * *****
}
** * ** * * * *
}
* ** **
}
answered by (-127 points)
0 0
prog.c: In function 'main':
prog.c:25:1: warning: implicit declaration of function 'getch' [-Wimplicit-function-declaration]
 getch();
 ^~~~~
/tmp/cc5D6dWh.o: In function `main':
prog.c:(.text+0xd3): undefined reference to `getch'
collect2: error: ld returned 1 exit status
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.159.115.9
©2016-2026

No related questions found

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