how to set parameter to specific variables of cuntion s java code example
Example 1: python create a function with optional parameter
def some_function (self, a, b, c, d = None, e = None, f = None, g = None, h = None):
#code
Example 2: how to declare function with multiple parameter c++
#include <iostream>
using namespace std;
int operate (int a, int b)
{
return (a*b);
}
float operate (float a, float b)
{
return (a/b);
}
int main ()
{
int x=5,y=2;
float n=5.0,m=2.0;
cout << operate (x,y);
cout << "\n";
cout << operate (n,m);
cout << "\n";
return 0;
}