3 like 0 dislike
16.8k views

Please take a look at the uncompleted program in the bottom and fill in the gaps with properly output format to complete the program in order to display the following output:
把還沒完成的程式寫完
Remember: Direct output or cheated output is always forbidden.

#include <stdio.h>
int main()
{
    int x = 21, y = 0xa , z = 077;
    printf("______________ \n", x);
    printf("______________ \n", x);
    printf("______________ \n", x);
    printf("______________ \n", x);
    printf("______________ \n", y);
    printf("______________ \n", y);
    printf("______________ \n", y);
    printf("______________ \n", z);
    printf("______________ \n", z);
    printf("______________ ", z);
    return 0;
}

Required output:

21
 21
15
25%
A
 a
10
77
077
63

 

[Exercise] Coding (C) - asked in Chapter 3: Formatted Input/Output by (12.1k points)
ID: 26463 - Available when: Unlimited - Due to: Unlimited

edited by | 16.8k views

87 Answers

0 like 0 dislike
Hidden content!
#include * *** ** *
int main()
{
int x=21,y=0xa,z=077;
* * * *** ** * ****** **** ** *
* * * ** *** * **** ** ** * ** **
* ******* *** *** ** ***** * * a\n",y);
***** * ***** * * ***** * **** * *
** *** * * ***** ***** **** * * ** * ** ***** 0;}
answered by (-336 points)
0 0
prog.c: In function 'main':
prog.c:6:8: error: too many arguments for format [-Werror=format-extra-args]
 printf("15\n",x);printf("25%%\n",x);
        ^~~~~~
prog.c:6:25: error: too many arguments for format [-Werror=format-extra-args]
 printf("15\n",x);printf("25%%\n",x);
                         ^~~~~~~~
prog.c:7:8: error: too many arguments for format [-Werror=format-extra-args]
 printf("A\n",y);printf(" a\n",y);
        ^~~~~
prog.c:7:24: error: too many arguments for format [-Werror=format-extra-args]
 printf("A\n",y);printf(" a\n",y);
                        ^~~~~~
prog.c:8:8: error: too many arguments for format [-Werror=format-extra-args]
 printf("10\n",y);printf("77\n",z);
        ^~~~~~
prog.c:8:25: error: too many arguments for format [-Werror=format-extra-args]
 printf("10\n",y);printf("77\n",z);
                         ^~~~~~
prog.c:9:8: error: too many arguments for format [-Werror=format-extra-args]
 printf("077\n",z);printf("63\n",z);return 0;}
        ^~~~~~~
prog.c:9:26: error: too many arguments for format [-Werror=format-extra-args]
 printf("077\n",z);printf("63\n",z);return 0;}
                          ^~~~~~
cc1: all warnings being treated as errors
0 like 0 dislike
Hidden content!
#include <stdio.h>

int main (void)
{
    int x = 21, y = 0xa , z = 077;

* * * **** * ** *** ** * * * x);
** * *** ** * *** * *** ** **** ** * x);
* ** * * ** **** * * **** ** x);
* *** ** *** ** *** * * ** * ****** * * ** x);
*** * **** * * ****** * *** * * **** * y);
** * * * ** * * * *** *** *** *** * * y);
* ** ***** ** **** * ** * * ** * y);
**** ***** *** ** * ** * * ** * * *** z);
* ** * * ** **** ** ** **** *** ** ******* ** z);
** * *** ** * * ** * *** * *** *** ** ** * z);

* ** * * *********** * 0;
}
answered by (-107 points)
0 0
Case 0: Correct output
0 like 0 dislike
Hidden content!
** *** * ***** *
int * * *
{ int x = 21, y = 0xa , z = 077;
**** * * * * x);
** * *** ** * ** * x);
** * * *** ** * **** * x);
* * * * * ** * x);
* * **** * * ** * * y);
** * * * ** * ** * * y);
* ** * ** ** ** ***** y);
** ** * * * ***** z);
*** ** ** ** * **
** * ** ** * z);
*** 0;
}
answered by (-329 points)
0 0
Case 0: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main()
{
int x=21,y=0xa,z=077;
* * ** * * ** ** *** * * *
** * ** ** * * * * **** *** ** * *
**** ** ** * **** ** ** * **** ** *****
** ** * ** * *** ***** ** ******* *
****** **** ** ** ******** * * ** * * ****** * * 0;}
answered by (-336 points)
0 0
prog.c: In function 'main':
prog.c:6:8: error: too many arguments for format [-Werror=format-extra-args]
 printf("15\n",x);printf("25%%\n",x);
        ^~~~~~
prog.c:6:25: error: too many arguments for format [-Werror=format-extra-args]
 printf("15\n",x);printf("25%%\n",x);
                         ^~~~~~~~
prog.c:7:8: error: too many arguments for format [-Werror=format-extra-args]
 printf("A\n",y);printf("a\n",y);
        ^~~~~
prog.c:7:24: error: too many arguments for format [-Werror=format-extra-args]
 printf("A\n",y);printf("a\n",y);
                        ^~~~~
prog.c:8:8: error: too many arguments for format [-Werror=format-extra-args]
 printf("10\n",y);printf("77\n",z);
        ^~~~~~
prog.c:8:25: error: too many arguments for format [-Werror=format-extra-args]
 printf("10\n",y);printf("77\n",z);
                         ^~~~~~
prog.c:9:8: error: too many arguments for format [-Werror=format-extra-args]
 printf("077\n",z);printf("63\n",z);return 0;}
        ^~~~~~~
prog.c:9:26: error: too many arguments for format [-Werror=format-extra-args]
 printf("077\n",z);printf("63\n",z);return 0;}
                          ^~~~~~
cc1: all warnings being treated as errors
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main()
 {
* ******** * * ** * * * * ** x = 21,     y = 0xa ,     z = 077;
* ** ** *** *** ** * ** *** **** *** * *** x);
** ** * ***** * * *** * *** * *** * x);
** *** ** * * * * ***** * * * ** ** * ** * * x);
** * * ** * * * ** * ** * * **** * * * ** * ** x);
*** ** ** *** * ** **** * ** **** y);
* * * ** * * ** * * **** *** ***** * * ** * y);
* ** **** * ** *** *** *** * * ** ** ** ** * y);
*** ***** * * *** * * ** * ***** *** z);
** ** * *** * **** *** * * **** * * * **** z);
* ** ***** * * * ** ** *** *** z);
* **** *** * * * * ***** ** * ** 0; }
answered by (-196 points)
0 0
Case 0: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>



int main (void)

{



*** *** * * ****** x = 21, y = 0xa , z = 077;


* * * ****** ** * ** * * *** * *** **** *** x);
** * * * ** * * ** * * * ** ** ** * * x);
*** * *** *** ** * *** * * * * * x);
* * * ** *** ******* *** ** *** \n", x);
* * **** ** * * ** **** ** *** * ****** * ***** y);
*** * * * * * ********* ****** y);
*** * *** * * *** *** **** ** * * * ** ** y);
** ****** *** *** ** *** * **** * * z);
* ** * ** * * * * *** ***** **** * z);
* ** *** ** * ** ** * * *** * * * * z);






** ** * * ** * * * * * * 0;




}
answered by (-107 points)
0 0
Case 0: Wrong output
0 like 0 dislike
Hidden content!
* ** ** * * **
int *** *
{
int x = 21, y = 0xa , z = 077;
***** * ** * * *** x);
** ** ** *** ** ** ** * ** x);
* * * * x);
**** **** * * * x);
* *** **** y);
* *** * * * * **** * y);
** ** ** * * * * ** y);
**** * * * * ** ** z);
** ** * *** * z);
* * *** ** * * * * *** z);
* * 0;
* *** * * ** **
answered by (-304 points)
0 0
Case 0: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main()
{
* * * * * ** *** *** x = 21, y = 0xa , z = 077;
**** ** * **** * * * ** * * * * x);
* * **** * * *** * ***** * * ** * x);
* * *** * *** ** ** ** -= 6;
***** * * *** * ** *** ** **** ** * ** * * x);
    x += 10;
* * * * ** ** ***** *** * *** *** * ** x);
* * ** * * ** * * * ** * * ** * ** * * y);
* * **** * ** * * *** * ******* ** * ******* y);

***** **** * * **** * **** ** * ** y);

** * * * * **** ** ** *** * *** ***** ** z);
** * ****** * ** * * *** ****** ** * ** z);

* * *** * * ** * ** **** * **** ** z);

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

int x = 21, y = 0xa , z = 077;

* *** * **** * ** * *** ** **** * * * x);
*** * * * * * * * **** * * * * * * * * x);
** * *** ** ** ** ** * * ** * ** x-6);
** ** * ** **** * * ** **** * * * x+4);



** ** * *** *** * * * * *** *** *** y);//A
** * ** * * * **** ** ** ******* y);//a



* ***** *** ** * * * * ** * * *** * y);


* **** ****** ** * * ******** ******** *** z+14);

* * *** ** * * ** **** ** ** ** * ***** z+14);

** * * * * ** ** ***** ** * ** z);

return 0;
}

//21 21 15 25% A a 10 77 077 63
answered by (-249 points)
0 0
prog.c: In function 'main':
prog.c:14:12: error: too many arguments for format [-Werror=format-extra-args]
     printf("A\n", y);//A
            ^~~~~
prog.c:15:12: error: too many arguments for format [-Werror=format-extra-args]
     printf("a\n", y);//a
            ^~~~~
cc1: all warnings being treated as errors
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main()
{
* ** *** ** * * ** * *** x = 21, y = 0xa , z = 077;
** ****** * * **** * * * ** ***** * **** x);
* * * ** *** ******* * * ** *** %d\n", x);
* * * * ** * ** *** ** **** * ** *** * * x);
* * * * **** *** * * ******* *** * * x);
** *** * * ** *** * * * * ** * **** *** *** ** y);
** * *** *** ** * * * * *** * %x\n", y);
** ** * * * * * *** * *** * **** ** * y);
** **** **** * * ** * * * ** ** * ** * z);
*** *** ** * * ** *** * ** * **** ** ** z);
** * * * * ***** * * * ** * * * * * z);
*** * * * * * ** *** ** * 0;
}
answered by (-258 points)
0 0
Case 0: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.126.17
©2016-2025

Related questions

1 like 0 dislike
75 answers
[Exercise] Coding (C) - asked Oct 12, 2017 in Chapter 3: Formatted Input/Output by thopd (12.1k points)
ID: 26464 - Available when: Unlimited - Due to: Unlimited
| 14.6k views
3 like 0 dislike
116 answers
[Exercise] Coding (C) - asked Oct 5, 2017 in Chapter 3: Formatted Input/Output by thopd (12.1k points)
ID: 25729 - Available when: Unlimited - Due to: Unlimited
| 20.6k views
12,783 questions
183,442 answers
172,219 comments
4,824 users