F Multiplication of two numbers in CPP using Function | CodeTheta

Multiplication of two numbers in CPP using Function

July 25, 2019

Code :
#include<iostream>
#include<conio.h>
using namespace std;

int MultiplicationFunction(int, int);

int main() {
    int n1, n2, result;
    cout<<"Enter First Number: ";
    cin>>n1;
    cout<<"Enter Second Number: ";
    cin>>n2;   
    result = MultiplicationFunction(n1, n2);
    cout<<"Result is: "<<result;
}

int MultiplicationFunction(int x, int y) {
    int output;
    output = x * y;
    return output;
}


Output :
Enter First Number: 10
Enter Second Number: 2
Result is:20

IDE Used To Test This Code : DEV C++.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us.We will reply you as soon as possible.

Post a Comment