Thursday 23 January 2020

Multiplication of two numbers in CPP (Using Function)

Source Code :
#include<iostream>
using namespace std;
void multiplication(int x,int y)
{
int z;
z=x*y;
cout<<"The multiplication of the two numbers is: ";
cout<<z;
}

int main()
{
int a,b;
cout<<"Enter two numbers: ";
cin>>a>>b;
multiplication(a,b);
return 0;
}


Program Output :
Enter two numbers: 5
7

The multiplication of the two numbers is: 35

No comments:

Post a Comment