0 like 0 dislike
1.8k views

Question 8: Please a write a program that receives 2 integer numbers, then outputs numbers between those inputs. If the inputs are equal, write the input number instead.

*No space between the output numbers*

Input1

1 5

Output 1

12345

 

Input2

-3 3

Output2

-3-2-10123

 

Input3

5 5

Output3

5

 

[Exam] asked in Final examination by (5.9k points)
ID: 41942 - Available when: Unlimited - Due to: 2018-01-17 16:30

edited by | 1.8k views

30 Answers

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

int main() {
* ** * *   int x,y;
* * * * **
    * ** ** * *** *** *****
*** * * ** ***** * * ** * * **
*** ** ** ***
**** * * * if(x!=y){
* * ** *** *** for(int ** ** ** * **
** *** * * * ** * ** ** * * ** ** * * * **
* * * ** * * ** * **** }
** ** * }else{
* * * * * * * ** * * * * ** ** ****
*** }
}
answered by (244 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    int a,b;
** * * * ***** * * ** * *** ** * *** &a, &b);
* * * ** ** * * * * * ** * * * *
* ** *** ** * *** * * *** ** ** ** *** ****** ***** ** *** *** ***** * * * * ** *** * * * * * * ** *
* * * * *** ** * * * * * ** * * * * ** * * ** ** * ** ** **** ** *** * * *
** * * * * * *** * ******** ** ******** * *** ** * ** * ** ** * ** **
** ** * ** * * * * ** * ** * ** ** * *** ** * * *** **** **** * ** * ** ** ** * * ** *** *** *
** * * * * * * * *** * ** ** *** * * *** * * * * * ******* *** * * * ** * ** ** *** ***** ***
** * * *** ** ** * * ** *** ***** *** ** * * * ** * * * * ** * *** ** **
  
* * ** ** * * ** ** ******  
  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!
*** *** * *

int main () {
* * ** * ** *
*** **** ** a; * * * * *** * ** *** ***
* *** * * * * * ** * * ** ** * * ** %f\n", a*0.07);
* ** *** ** *** *** * *** *** *** * ***** *** * * * **
* * * ** * **** **** * 0;
}
answered by (183 points)
1 0
prog.c: In function 'main':
prog.c:7:15: warning: unknown conversion type character 0xc in format [-Wformat=]
      printf("%\fn",a+a*0.07);
               ^
prog.c:7:13: warning: too many arguments for format [-Wformat-extra-args]
      printf("%\fn",a+a*0.07);
             ^~~~~~
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
** **** **** ** a,b;
* * * *** ***** * * ** * *** ** * * * * * * ** **
  while(a<=b){
* *** ** *** ** ** *** * * *** * * *** * **** ** * ** **** ** ** * * * * * ** * *
** *** * * *** ******* **** * ** ** * ***** * *** *** * * * * * **** ****
* *** ** * * * * *** * ** *** * ***** *** * * * ** ***** ** *** * * * **
* * *** ***** * ** ** **** ** * ** ******** * ** * * * ***** * * ** *** **
* * * ****** **** ** * ***** ****** * ** ** * * *** * * ** * ** *** ** *** ** * * *
* *** * * * * ** *** * * ** * * ** * * * **** * * **** **** * ** *
  
** ***** * **** * *** * * * * *  
  return 0;
}
100/100 answered by (243 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 <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
   
    int a,b;
*** * *** * *** *** * * * * ** * ** *** *
* * *** * ** *** ** * * * * **
*** ** *** * ** * **** *** * * * ***** ** ** ** * * * * *** * * * *** * ** * **** * * ** * );
**** * * * * * * *** * * ** ******* * * *** *** * ** * **** ** * * **** *** * *** **
** * **** ***** * * **** ***** **** * * * * ** ** * ***** * ** * ** * * * * * * *** ***
*** *** *** *** **** ***** * *** * * ** * ** ** * * ******* * ** *** ** * * ***** *** ** ***
** *** * ** ** *** * * * ** **** * * *** *** ***** ** ******* ** * ** * * * ** ** *** * * ***** * ** ** );
* * * ******* ** * * ** ** ** * * ** **** * *** * * * ** * ***** *** *****
*** * * ** * * *** ** * ("PAUSE");    
    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 <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
int a,b;
** * ** *** * * * * **** **** **
while(a<=b){
* ******* **** ***** ** *** * ***** **** ** * * * * *** * ** ** * * * * * a);
* * *** ***** * * * ** *** * * ** * * **** * * ** * *** * *
* **** * ****** * * ** * * * * *** **** **** * *** * ** **** ** *
if(a==b)
*** ** *** * * ** * *** ** * ** * * * * * * ** * **** * * * * *** *
* ** * * ** *** * ** * * * *** *** ********* ** *** * ** * ** *** * * *
system * * * * ****
* ** ***** * * ***** ** 0;

}
100/100 answered by (290 points)
0 0
prog.c: In function 'main':
prog.c:6:1: error: expected declaration specifiers before 'scanf'
 scanf("%d%d",&a&b);
 ^~~~~
prog.c:7:1: error: expected declaration specifiers before 'while'
 while(a<=b){
 ^~~~~
prog.c:11:1: error: expected declaration specifiers before 'if'
 if(a==b)
 ^~
prog.c:14:1: error: expected declaration specifiers before 'system'
 system ("PAUSE");
 ^~~~~~
prog.c:15:5: error: expected declaration specifiers before 'return'
     return 0;
     ^~~~~~
prog.c:17:1: error: expected declaration specifiers before '}' token
 }
 ^
prog.c:4:5: error: old-style parameter declarations in prototyped function definition
 int main(int argc, char *argv[])
     ^~~~
prog.c:17:1: error: expected '{' at end of input
 }
 ^
0 0
prog.c: In function 'main':
prog.c:6:1: error: expected declaration specifiers before 'scanf'
 scanf("%d%d",&a,&b);
 ^~~~~
prog.c:7:1: error: expected declaration specifiers before 'while'
 while(a<=b){
 ^~~~~
prog.c:11:1: error: expected declaration specifiers before 'if'
 if(a==b)
 ^~
prog.c:14:1: error: expected declaration specifiers before 'system'
 system ("PAUSE");
 ^~~~~~
prog.c:15:5: error: expected declaration specifiers before 'return'
     return 0;
     ^~~~~~
prog.c:17:1: error: expected declaration specifiers before '}' token
 }
 ^
prog.c:4:5: error: old-style parameter declarations in prototyped function definition
 int main(int argc, char *argv[])
     ^~~~
prog.c:17:1: error: expected '{' at end of input
 }
 ^
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 <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
* **** * * *** * * * a,b;
* * * * * ** * * *** *** *** *** ** * **** * *
* ***** * *** * *** * * ****
* * **** * * * **** ** ****** ** * ** * ****** *** * * ** * **** * * ** * * * * ** * ** *** a);
* * * *** * ** ** * * * ** ** *** * ** ** * * ** * ** * * * *
**** * * * * * ** * * ** *** *** ***** * **** *** * ** *** ** ** ***********
****** * * * ******** ****** *** ** ** * * * * *** * ** *** * ***** *
**** *** *** ** * ** *** * * * * ** ** *** * ****** **** ***** * * * * * * * *** *** ****
   
  
* ***** ****** * **    
  return 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
0 like 0 dislike
Hidden content!
#include ** * ** * * *
int main(){

* ** * ****** int x, y, i;
* ** * * * * * ** **** ** * *
** * * *** * ********* * * **
* * * * * *** **** *
* * *   * * ** *** * *** * * ** * x);
* ** ** ** }
**** * *

** *** ** * * * 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 i =a; ** * ** *
* **** ** * **** * * **** ** *
}
answered by (183 points)
0 1
prog.c:1:1: error: expected identifier or '(' before 'for'
 for( int i =a; i<=b; i++){
 ^~~
prog.c:1:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
 for( int i =a; i<=b; i++){
                 ^~
prog.c:1:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
 for( int i =a; i<=b; i++){
                       ^~
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
** *** * * *** ** *** a,b;
** **** * * ** * ****** **** *** *** **** ** * * **
*** ***** * * ** *****
**** ** * * * * * **** ** * * * * * * **** ** * * ** * * * *** ** * ** * ** ** * a);
** * *** ** * * ** *** * * * * ** ***** *** * * * * * * * * * *
* * ** ** ****** * *** ***** * * ** * * ** * **** ** * ** * ******
***** **** * ** * * * * * ** **** ** * ****** * * *** * * ** **** * * ***** * *** ****
*** * * *** *** * *** ** ***** * *** * * ** ** *** * ** * ** * * * * * * *** ** * * *
   
  
* * **** **** **** * ** * * *****  
  return 0;
}
100/100 answered by (227 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.179.143
©2016-2024

Related questions

0 like 0 dislike
22 answers
[Exam] asked Jan 13, 2018 in Final examination by nat236919 (5.9k points)
ID: 41975 - Available when: Unlimited - Due to: 2018-01-17 16:30
| 1.5k views
0 like 0 dislike
21 answers
[Exam] asked Jan 13, 2018 in Final examination by nat236919 (5.9k points)
ID: 41968 - Available when: Unlimited - Due to: Unlimited
| 1.5k views
0 like 0 dislike
26 answers
[Exam] asked Jan 13, 2018 in Final examination by nat236919 (5.9k points)
ID: 41937 - Available when: Unlimited - Due to: 2018-01-17 16:30
| 924 views
0 like 0 dislike
21 answers
[Exam] asked Jan 13, 2018 in Final examination by nat236919 (5.9k points)
ID: 41935 - Available when: Unlimited - Due to: 2018-01-17 16:30
| 701 views
0 like 0 dislike
23 answers
[Exam] asked Jan 13, 2018 in Final examination by nat236919 (5.9k points)
ID: 41926 - Available when: Unlimited - Due to: 2018-01-17 16:30
| 871 views
12,783 questions
183,443 answers
172,219 comments
4,824 users