0 like 0 dislike
607 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
| 607 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)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.58.213
©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
| 1k 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
| 780 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
| 582 views
12,783 questions
183,443 answers
172,219 comments
4,824 users