Professional Documents
Culture Documents
LabSheet 1 ModularProgrammingRevisited I
LabSheet 1 ModularProgrammingRevisited I
2. Study the code given below: #include <cstdlib> #include <iostream> using namespace std; int main() { double N1, N2, Product, Divide; cout << "Please Enter The First Number: "; cin >> N1; cout << "Please Enter The Second Number: "; cin >> N2; Product = N1 * N2; Divide = N1 / N2; cout << "The Product Of The Two Numbers Is: "; cout << Product << endl; cout << "The Division Result For The Two Numbers Is: "; cout << Divide << endl; system("pause"); return 0; } A sample output of the above code is given below: Please Enter The First Number: 4 Please Enter The Second Number: 5 The Product Of The Two Numbers Is: 20 The Division Result For The Two Numbers Is: 0.8 Press any key to continue Rewrite the above program by including 2 user-defined functions Multiply() and Div() without affecting the output of the program. Multiply() and Div() functions should contain their respective calculations and displays. Use Functions with arguments to solve the problem. Ensure that you do not use global variables.