# C++ Exercises

## C++ Program to calculate multiplication of two numbers

Let see the program multiplication two numbers.

```Example:
Declare three variables they are integer or float data types x, y,z.
Declare one int data type and one float datatype, then store float data type.
Declare two float data type, then store float data type.
Declare two integer data types, then store integer data type.
Input x=10,y=5
Then z=x*y
Multiplicity two numbers z=50.
Input x=15,y=10.5
Then z=x*y
Multiplicity two numbers z=157.5
Input x=10.5,y=15
Then z=x*y
Multiplicity two numbers z=157.5
Input x=20.5,y=10.7
Then z=x*y
Multiplicity two numbers z=219.35
```

```#include <iostream>

using namespace std;
int main()
{
float number1,number2,mul;
cout<<"Enter First number :";
cin>>number1;
cout<<"Enter second number :";
cin>>number2;
mul=number1*number2;
cout<<" Multiplication of two numbers :"<<mul<<endl;
return 0;
}

```

##### Output:

```Enter First number :7.3
Enter second number:5.2

Multiplication of two numbers:37.96

```

```#include <iostream>

using namespace std;
int main()
{
int number1;
float number2,mul;
cout<<"Enter First number :";
cin>>number1;
cout<<"Enter second number :";
cin>>number2;
mul=number1*number2;
cout<<" Multiplication of two numbers :"<<mul<<endl;
return 0;
}

```

##### Output:

```Enter First number:5
Enter second number:7.3

Multiplication of two numbers:36.5

```

```#include <iostream>

using namespace std;
int main()
{
int number1,number2,mul;
cout<<"Enter First number :";
cin>>number1;
cout<<"Enter second number :";
cin>>number2;
mul=number1*number2;
cout<<" Multiplication of two numbers :"<<mul<<endl;
return 0;
}

```

##### Output:

```Enter First number :7
Enter second number:20

Multiplication of two numbers:140

```