This program calculates the product of two integers using a function called pro(). In the pro() function, two integer arguments num1 and num2 are passed, and their product is stored in num3. Finally, num3 is returned as the result of the function. In the main() function, pro() is called with two arguments 2 and 5, and the result is printed on the console using cout. The output of this program would be 10, which is the product of 2 and 5.
#include<iostream> using namespace std; int pro(int num1, int num2) { int num3=num2*num1; return num3; } int main() { cout<<pro(2,5); return 0; }To download raw file Click Here
10
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions