0 like 0 dislike
1.2k views

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)
ID: 39813 - Available when: Unlimited - Due to: Unlimited
| 1.2k 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)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.71.254.109
©2016-2024

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)
ID: 40236 - Available when: Unlimited - Due to: Unlimited
| 2.5k 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)
ID: 39810 - Available when: Unlimited - Due to: Unlimited
| 2k 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)
ID: 37578 - Available when: Unlimited - Due to: Unlimited
| 1.3k views
12,783 questions
183,443 answers
172,219 comments
4,824 users