Created
October 11, 2022 14:27
-
-
Save PaxPrz/d0237b2ab49088079a3412603f7507f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int add(int a, int b){ | |
cout << "It's an integer sum" << endl; | |
return a + b; | |
} | |
double add(double a, double b){ | |
cout << "It's a double sum" << endl; | |
return a + b; | |
} | |
double add(double a, double b, double c){ | |
cout << "It's a triple sum" << endl; | |
return a + b + c; | |
} | |
int main(){ | |
add(1, 3); // It's an integer sum: 4 | |
add(1.1, 3.3); // It's a double sum: 4.4 | |
add(1, 2.2, 3); // It's a triple sum: 6.2 | |
return 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment