0 like 0 dislike

11. There are some mistakes in the code, please fix them by using your compiler, and post your code here.

(can be answered 2 times)

#include <stdio.h>

int main(int argc, char *argv[]) {

int country_code;
scanf ("%d", &country_code);

if (country_code==886){
    printf("Taiwan");
}

else (country_code==976){
    printf("Mongolia");
}

else if (country_code==62){
    printf("Indonesia");
}

else if (country_code==66){
    printf("Thailand");
}

else
    printf("No");

    return 0
[Exam] asked in Mid-term examination by (5.9k points)
Available when: Unlimited - Due to: 2017-11-15 16:10
| 275 views

21 Answers

0 like 0 dislike
Hidden content!
#include * * * **

int main(int argc, char *argv[]) {

int *****
scanf **** * ** ** * * ** *

if * * ** ***
**** * *** ***** * * ** * * * ** *
}

else **** ***
**** *** *** * *** * *** *** * ****
}

else if *** *
** * ** ** * ***** *** **** ** **** *
}

else if *** ***
** * * ******* ******* * * ** ****** **
}

else
** * * **** ** ** * *** ** * * ** **

* ************** ** * * 0
1/100 answered by (135 points)
0 0
prog.c: In function 'main':
prog.c:16:1: error: 'else' without a previous 'if'
 else if (country_code==62);{
 ^~~~
prog.c:20:1: error: 'else' without a previous 'if'
 else if (country_code==66);{
 ^~~~
prog.c:24:1: error: 'else' without a previous 'if'
 else
 ^~~~
prog.c:27:5: error: expected ';' at end of input
     return 0
     ^~~~~~
prog.c:27:5: error: expected declaration or statement at end of input
0 like 0 dislike
Hidden content!
#include ** * **

int main(int argc, char *argv[]) {

int *** * * *
scanf ** * * **** * **** * *******

if **** ** *
*** ** ** * ** ** ** * * **** *
}

else if * * * ***
* * * **** ******* * ** ** * * ** **** *
}

else if * * ***
* * ** ** ** *** * ******* ** * * **** ** **
}

else if * *** *** *
** *** *** ***** * * ** * * *
}

else
*** * * ** ** ** ** * ** * *** ** * ***


** * * **** **** * * *** 0;
}
100/100 answered by (221 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include ** * * *

int main(int argc, char *argv[]) {

int country_code;
scanf *** **** * *** * * ****

if * ** * *
* ***** * * * *** ** * * ** ** * ***** * *
}

else * * * ***
* * ******* *** * * * * ***** * * **
}

else if * *** ***
**** * * * ** * * * * *** * * * *
}

else if **** * ** *
*** * ** *** ** * *** ** ** ** * *** *
}

else
* * ******** * * * * * * **
* * * **** * *
*** **** **** * *** 0;
}

* * *******
100/100 answered by (246 points)
0 0
prog.c:1:1: error: expected identifier or '(' before 'else'
 else if(country_code==976){
 ^~~~
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
**** * * * ***
*** *** *******

/* run this ** *** the * ** or add your own ** ** * *** *** * * or **** loop */

int * ** ** char {
** * * ****
int ***
** ** * * ** * * * ** **** **

if * *** * == **
** * * * ** ** ** * ****** * * *
}

* * if *** == * *
** *** **** ** * ** * *** *** *
}

* if * ** == 62){
** * **** * ** * * * ** **** * *******
}

else if * * * == 66){
** * ** *** ** * * * ****** ** * **
}

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

***** ***
** ** * ** * 0;
}
100/100 answered by (281 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include *** ** * ** * *

int main(int argc, char *argv[]) {

int * *
scanf ** **** * ******

if * * **** **
* ***** * * * *** * * ** * * * ****** ** * *
}

else if ** ***** * *
* *** ** *** * ** ** * ******* ***
}

else if * * **** * *
* ** ** ** * * * **** *** * * * * * * *
}

else if *** **** * * *
****** * * * * * * ** ** ** * * * ** *
}

else
* *** * * *** ** ** ** ** *** *** **

* * * *** * * *** 0;
}
100/100 answered by (268 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
**** * ****** *

int main(int argc, char ** ** {

int * **
scanf ** **** * * *** * ****

if *********
* * * *** * * * * * * ** * * *
}

else if * * ** ****
** * * * * * ** * **** * ** ** *** **
}

else if * ** * **
****** * * ** * * * * * * *** ** *** ** *
}

else if * ** * ***
**** * *** * * ** **** ** *** * **
}

else
** ** * ** **** ******** ** ***** *

return 0;
}
100/100 answered by (269 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include *** * ** *

int main(int argc, char *argv[]) {

int *** * *
scanf * *** * *** * ** * *

if **** * **
* ** * * * * * ** * ***** ** * * * *
}

else if * ** *
** ** * ***** ** * * *****
}

else if ** * * **
*** ** * * * * ** * ** * ** ** ** * * ****
}

else if * * * **
** * ***** * * ** * *** * * * * * * * ******
}

else
* * ** * ** ******** ** * * * * * *

* ****** * * * * **** 0;
}
100/100 answered by (273 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include * * ** * * ***

int main(int argc, char *argv[]) {

int * *****
scanf ** ** * * *** * * * ** **

if * ** ***** *
*** * ** * ** * * * * ** ** * ****** ****
}

else if * * ** * **
*** * * * ** ** ** * * * * * * * **
}

else if * ** * * *
* ** *** ** **** *** * * * ** * * * ****** * *
}

else if *** ******
* *** ** * * * ** * * ** ** * ***** ** * * * **
}

else
* ** * *** * ** * * * *

* ** * * * **** *** ** ** 0;
}
100/100 answered by (290 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
* * * * *
** * * * ** ***

/* run this * * using the * *** * or add your own * * *** * ***** * ** or input loop */

int * * argc, char * {
int *
* * ** **** * *** *

if ** *** ****
** ** ** * **** ** *** * * * * **** ** * **
}

else if ** **
** ***** * * * ** ** * ****** *** * ****
}

else if * ** *
***** *** ** **** * ** * * **** * * **** **
}

else if * **
** ****** ** ** * * * * ** * *
}

else
* *** * **** * ** * * ** * ** *** ** * * *
* * * 0;
}
100/100 answered by (252 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include ***** ***

int main(int argc, char *argv[]) {

int ** * **
scanf ** ** * * **** * *

if * * * * * *
* * * * * **** * ***** * ** * * **** ** **
}

else if * **** * *
** * * ** ** ****** *** * * ** **** *** * *
}

else if * * *
*** ** ** * * **** ** **** ** ** ***
}

else if ** ** ** *
**** *** *** *** * ** * * * ******** *
}

else
* * * * ****** ** ** * * * ***

*** * * * * * ** ** * *** * 0;
}
100/100 answered by (271 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.62.130
©2016-2020

Related questions

0 like 0 dislike
21 answers
[Exam] asked Nov 15, 2017 in Mid-term examination by nat236919 (5.9k points)
Available when: Unlimited - Due to: 2017-11-15 16:10
| 195 views
0 like 0 dislike
19 answers
[Exam] asked Nov 14, 2017 in Mid-term examination by nat236919 (5.9k points)
Available when: Unlimited - Due to: 2017-11-15 16:30
| 237 views
0 like 0 dislike
22 answers
[Exam] asked Nov 14, 2017 in Mid-term examination by nat236919 (5.9k points)
Available when: Unlimited - Due to: 2017-11-15 16:10
| 127 views
0 like 0 dislike
22 answers
[Exam] asked Nov 14, 2017 in Mid-term examination by nat236919 (5.9k points)
Available when: Unlimited - Due to: 2017-11-15 16:10
| 98 views
0 like 0 dislike
21 answers
[Exam] asked Nov 14, 2017 in Mid-term examination by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 77 views
10,769 questions
120,689 answers
112,784 comments
3,802 users