C++ Programming

Program to use a separate statement to print each operand.

#include<iostream>
using namespace std;
int main()
{

//Delaration of variables
int x,y;

//reading input

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

x =0, y =0;

cin>>x >>y;

//Print the product

cout <<"The product of ";

cout <<x;

cout <<" and ";

cout <<y;

cout <<" is ";

cout <<x*y;

cout <<endl;

return 0;

}

Output

Enter two numbers:
3
2
The product of 3 and 2 is 6
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments