-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
82 lines (35 loc) · 1.15 KB
/
main.cpp
File metadata and controls
82 lines (35 loc) · 1.15 KB
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
//
// main.cpp
// MathRecode
//
// Created by Hitarth Choudhary on 2024-10-04.
//
#include <iostream>
#include <cmath>
int main () {
// variable initialisation
double selection;
int number;
int Answer;
std::cout << "Welcome to MathRecode. Designed by Hitarth Choudhary in C++. MathRecode v1.0 \n";
std::cout << "Number?\n";
std::cin >> number;
std::cout << "1. Square, 2. Squareroot 3. Cube 4. Cuberoot\n";
std::cin >> selection;
if(selection == 1) {
int Answer = number * number;
std::cout << Answer << "\n";
};
if(selection == 2) {
int Answer = sqrt(number);
std::cout << Answer << "\n";
};
if(selection == 3) {
int Answer = number * number * number;
std::cout << Answer << "\n";
};
if(selection == 4) {
int Answer = cbrt(number);
std::cout << Answer << "\n";
};
};