Mohammad Abd El-Fattah Mohammad
Cybersecurity & AI Engineer
Open to opportunities

Programming

Overload Function

Shows function overloading: one function multiplies two integers, another subtracts an integer from a double. Prints a result for each.

By Mohammad Abd El-Fattah Mohammad · 1 min read

Source Code

#include<iostream>
using namespace std;
int x(int n, int m) {
	return n * m;
}
double x(double n, int m) {
	return n - m;
}
int main() {
	cout << "Value=" << x (5  , 2) << endl;
	cout << "Value=" << x (2.5, 8) << endl;
	return 0;
}

Source file in my repo: Basics/Overload_Function