C++ Programming

Write a program that uses the multiplication operator, *, to print the product.

#include<iostream>
using namespace std;

int main()

{

//Variable declaration

int x,y;

cout<<"Enter two numbers:"<<endl;

//Variable initialsation

x = 0, y = 0;

cin>>x>>y;

//Product of two variables

cout<<"The product is "<<x*y <<endl;

return 0;

}

Output

2
4
The product is 8
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments