Friday, September 27, 2019

Product of Two Numbers Using C++ Functions

In this article, I would like to discuss how to create a function to ask the user to give two numbers and then the program will compute the product of two numbers and display the results on the screen using C++ programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.


My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.


My personal website is http://www.jakerpomperada.com.


Program Listing

// product.cpp
// Author : Mr. Jake Rodriguez Pomperada, MAED-IT
// Date   : September 27, 2019   Friday   5:55 AM
// Location : Bacolod City, Negros Occidental Philippines

#include <iostream>

using namespace std;

int solve_product(int a, int b); // function prototype

int main() {
int x=0,y=0;
cout <<"\n\n";
cout <<"\tProduct of Two Numbers Using Functions in C++";
cout <<"\n\n";
cout << "\tGive Two Numbers : ";
cin >> x >> y;
cout <<"\n\n";
cout <<"\tThe product of " 
     << x << " and " << y << " is "
     << solve_product(x,y) << ".";
     
cout <<"\n\n";
cout << "\tEnd of The Program.";
}


int solve_product(int a, int b)
{
return(a*b);
}



No comments:

Post a Comment