-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
106 lines (63 loc) · 1.94 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#include <stdio.h>
#include "connect.h"
int main(int argc, char** argv){
int choice,i,output;
while(1) {
printf("\n ~~~~~~~~~~~~~~~~~~~~~~~~ \n Welcome to CMaths (Ultimate C Maths App)\n\n ");
printf(" ~~~~~~~~~~~~~~~~~~~~~~~~");
printf("\n Would you like to do..?\n\n\t");
printf("1-check even or odd 2-check prime number or not\n\t");
printf("3-Check Divisbility 4-Check golden ratio\n\t");
printf("5-Compute Factorial 6-Compute Fibonacci series\n\t");
printf("7-Compute Pi 8-Solve a quadratic equation \n\t");
printf("9-Logarithms Calculator 10-Compute Pascal's Triangle\n\t");
printf("Choose an option :\n\n>>");
scanf("%d", &choice);
switch(choice) {
// Check odd or even
case 1:
checkOddOrEven();
break;
// check prime number or not
case 2:
checkPrime();
break;
// Check Divisbility
case 3:
checkDivisbility();
break;
// Check golden ratio
case 4:
checkGoldenRatio();
break;
// Compute Factorial
case 5:
ComputeFactorial();
break;
// Compute Fibonacci series
case 6:
ComputeFibonacci();
break;
// Compute Pi
case 7:
ComputePi();
break;
// Solve a quadratic equation
case 8:
QuadraticEquation();
break;
// Logarithms Calculator
case 9:
Logarithm();
break;
// Compute Pascal's Triangle
case 10:
printf("Work in progress..");
break;
default:
printf("Error!!");
break;
}
}
return 0;
}