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
| 240 views

18 Answers

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

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

a-b
100/100 answered
0 like 0 dislike
Hidden content!
** **
* ** *
* *

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

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

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

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

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

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

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

a-b
100/100 answered by (273 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.68.65.26
©2016-2021

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
| 241 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
| 222 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
| 180 views
11,163 questions
132,617 answers
129,948 comments
3,823 users