0 like 0 dislike

Please fix the code given below to perform subtraction of two inputs:

#include <stdio.h>
#include <stdlib.h>

int readNumber(); 
void $1(int number);

int main(int argc, char *argv[])
{
  
  int a, b;
  a = $2;
  b = $3;
  
  writeNumber($4);

  return 0;
}

void writeNumber(int number){
     printf("%d",number);
     return;
}

int readNumber(){
    int x;
    scanf("%d", &x);
    return x;    
}

 

Input 1

10 11

Output 1

10 11
-1

 

Input 2

90 12

Output

90 12
78

 

[Exercise] Fill in the blank - asked in Chapter 3: Branching, Looping and Functions by (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 44 views

18 Answers

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

a-b
answered by (273 points)
0 like 0 dislike
Hidden content!
* * *
****** *
****

a-b
100/100 answered by (290 points)
0 like 0 dislike
Hidden content!
* *
** * **
** **

a-b
100/100 answered by (271 points)
0 like 0 dislike
Hidden content!
*** *
*** **
** * *****

a-b
100/100 answered by (268 points)
0 like 0 dislike
Hidden content!
* * **
*
****

a-b
100/100 answered by (220 points)
0 like 0 dislike
Hidden content!
*** * *
* * **
* * * ** *

a-b
100/100 answered by (283 points)
edited by
0 like 0 dislike
Hidden content!
* * **
* * * **
** * ****

a-b
100/100 answered by (153 points)
0 like 0 dislike
Hidden content!
* *
***
** *

a-b
100/100 answered by (252 points)
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.63.39
©2016-2019

Related questions

0 like 0 dislike
22 answers
[Exercise] Coding (C) - asked Dec 30, 2017 in Chapter 3: Branching, Looping and Functions by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 84 views
0 like 0 dislike
16 answers
[Exercise] Coding (C) - asked Dec 23, 2017 in Chapter 3: Branching, Looping and Functions by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 71 views
0 like 0 dislike
20 answers
[Exercise] Fill in the blank - asked Dec 15, 2017 in Chapter 4: Arrays by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 59 views
8,379 questions
65,746 answers
39,979 comments
1,515 users