Documente Academic
Documente Profesional
Documente Cultură
Int main()
return 0;
}
3-Return type Functionname
(parameters)
Function definition
Int getx (int x)
{
Return 7*x;
}
Int main ()
{
Int y=3;
Function call
Int t= getx (y)
Cout << t;
}
Function
Function definition
Int calculationmax (int I, int j);
{
If (i>j)
Return i;
Else
Return j;
}
Int main ()
{
Int no1=3;
Int no2=10;
Function call
Int max= calculationmax (no1, no2);
cout << max;
}
4- Void Functionname (parameters)
void test1(int i)
{
cout << i *5<< endl;
}
Int main()
{
Test1(3);
}
Output is 15
Int test1()
{
cout << ‘the first and second number’;
cin >> a >> b;
If a>b
<< a
Else
Cout <<b
}
Int main()
{
test1 ();
}
Cout << test1 ();
int test1()
{
cout << ‘the first and second number’;
If a>b
Return a
Else
Return b
}
Int main()
Int f= test1 ();
Cout <<f;