-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy path7.c
More file actions
31 lines (24 loc) · 642 Bytes
/
Copy path7.c
File metadata and controls
31 lines (24 loc) · 642 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
// Function to add two numbers
int add(int a, int b)
{
return a + b;
}
// Function to subtract two numbers
int sub(int a, int b)
{
return a - b;
}
int main()
{
int num1 = 20;
int num2 = 10;
// Calculate the sum of the two numbers using the add() function
int sum = add(num1, num2);
// Calculate the difference of the two numbers using the sub() function
int diff = sub(num1, num2);
// Print the results
printf("The sum of %d and %d is %d\n", num1, num2, sum);
printf("The difference of %d and %d is %d\n", num1, num2, diff);
return 0;
}