# C++ Exercises

## C++ Program to calculate the division of two numbers.

Let see the program division two numbers.

```Example:
Declare two variables they are integer data types x, y, and store the value
in z then declares a float data type.
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 float data type.
Input x=10,y=5
Then z=x/y
Division two numbers z=2
Input x=15,y=10.5
Then z=x/y
Division two numbers z=1.428571428571429
Input x=10.5,y=15
Then z=x/y
Division two numbers z=0.7
Input x=20.5,y=10.7
Then z=x/y
Division two numbers z=1.91588785046729
```

```#include <iostream>

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

```

##### Output:

```Enter First number :10
Enter second number:7

Multiplication of two numbers:1.428571

```

```#include <iostream>

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

```

##### Output:

``` Enter First number:10
Enter second number:7

Multiplication of two numbers:1

Note: Declare two variables they are integer data types x, y, and store the value
in z then declares a int data type.For example x=10 and y=7 then a division of two numbers (z=x/y) z=1.428571 but
z declare int data type then store z=1.```

```#include <iostream>

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

```

##### Output:

```Enter First number :3.5
Enter second number:2.7

Division of two numbers:1.2963

```