0 like 0 dislike

12. 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>
#include <stdlib.h>

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

scanf("%d",a);

if(a%2!=0){
	print("Odd");
}else

print("Even");

	return 0;
}

 

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

21 Answers

0 like 0 dislike
Hidden content!
** ** * *** * *
** * *** * *** * *

int *** argc, char *** {
int a;

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

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


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

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

int *** * argc, char *** {
int a;

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

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

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

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

int ** ** argc, char ** * {
int a;

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

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

* *** * ** ** *

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

int *** argc, char {
int a;

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

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

* * **** * * * **

* *** ***** ** return 0;
}
100/100 answered by (153 points)
0 0
prog.c: In function 'main':
prog.c:7:9: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
 scanf("%d",a);
         ^
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
* *** * * ** *
**** * * * *

int ** * argc, char ** * * {
int a;
* ******* * ** *** *

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

* * * ** * *

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

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

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

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

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

int argc, char * *** {
int a

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

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

* *
** ** * ***** **** *
}
* * * return 0;
}
1/100 answered by (449 points)
0 0
prog.c: In function 'main':
prog.c:7:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
 scanf("%d",a);
 ^~~~~
prog.c:7:12: error: 'a' undeclared (first use in this function)
 scanf("%d",a);
            ^
prog.c:7:12: note: each undeclared identifier is reported only once for each function it appears in
prog.c:10:2: warning: implicit declaration of function 'print' [-Wimplicit-function-declaration]
  print("Odd");
  ^~~~~
0 like 0 dislike
Hidden content!
** * *** *** **
* * * ** * **

int * argc, char * * {
int a;

* * * * * ** * ***

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

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

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

int ** ** argc, char * *** {
int a;

* * ** * ** * ***

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

*** * * * * ***

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

int *** argc, char * {
int a;

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

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

* * * *****

* * * return 0;
}
100/100 answered by (220 points)
0 0
Case 0: Correct output
Case 1: 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.148
©2016-2019

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
| 27 views
0 like 0 dislike
18 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
| 37 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
| 10 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
| 6 views
0 like 0 dislike
20 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
| 7 views
8,362 questions
65,603 answers
39,828 comments
1,506 users