This commit is contained in:
19
project_cpp/functions.cpp
Normal file
19
project_cpp/functions.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
|
||||
int add (int a, int b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
|
||||
int multiple (int a, int b) {
|
||||
return a * b;
|
||||
}
|
||||
|
||||
int substraction (int a, int b) {
|
||||
return a - b;
|
||||
}
|
||||
|
||||
int devide (int a, int b) {
|
||||
return round(a / b);
|
||||
}
|
||||
@@ -1,22 +1,23 @@
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
#include "./functions.cpp"
|
||||
|
||||
int add (int a, int b) {
|
||||
return a + b;
|
||||
}
|
||||
// int add (int a, int b) {
|
||||
// return a + b;
|
||||
// }
|
||||
|
||||
|
||||
int multiple (int a, int b) {
|
||||
return a * b;
|
||||
}
|
||||
// int multiple (int a, int b) {
|
||||
// return a * b;
|
||||
// }
|
||||
|
||||
int substraction (int a, int b) {
|
||||
return a - b;
|
||||
}
|
||||
// int substraction (int a, int b) {
|
||||
// return a - b;
|
||||
// }
|
||||
|
||||
int devide (int a, int b) {
|
||||
return round(a / b);
|
||||
}
|
||||
// int devide (int a, int b) {
|
||||
// return round(a / b);
|
||||
// }
|
||||
|
||||
int main () {
|
||||
std::cout << "ADD: " << add(4, 5) << "\n";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <iostream>
|
||||
#include "../project_cpp/main.cpp"
|
||||
#include "../project_cpp/functions.cpp"
|
||||
|
||||
int add_test() {
|
||||
if(add(4, 5) != 9) {
|
||||
|
||||
Reference in New Issue
Block a user