-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
55 lines (50 loc) · 1.43 KB
/
main.c
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "BigInteger.h"
#include <stdio.h>
int main() {
long long int a, b, choice;
printf("Enter two integers:\n");
scanf("%lld %lld", &a, &b);
BigInteger* num1 = createFromInt(a);
BigInteger* num2 = createFromInt(b);
BigInteger* sum;
BigInteger* difference;
BigInteger* quotient;
BigInteger* remainder;
BigInteger* product;
printf("Enter choice\n");
printf("\t 1 for addition \n");
printf("\t 2 for subtraction \n");
printf("\t 3 for multiplication \n");
printf("\t 4 for division \n");
printf("\t 5 for modulus \n");
scanf("%lld", &choice);
switch(choice) {
case 1:
sum = add(num1, num2);
printf("Sum: ");
display(sum);
break;
case 2:
difference = sub(num1, num2);
printf("Difference: ");
display(difference);
break;
case 3: product = mul(num1, num2);
printf("Product: ");
display(product);
break;
case 4:
quotient = divi(num1, num2);
printf("Quotient: ");
display(quotient);
break;
case 5:
remainder =mod(num1, num2);
printf("Remainder: ");
display(remainder);
break;
default:
printf("Invalid choice");
}
return 0;
}