C++ Program to find the division of two integer numbers
Program
#include<iostream>
using namespace std;
int main()
{
int a, b, divide;
cout << "Enter value of a:\t";
cin >> a;
cout << "Enter value of b:\t";
cin >> b;
if(b == 0)
cout << "Cannot Divide. Divide By 0 Error" << endl;
else
{
divide = a / b;
cout << "Quotient = " << divide << endl;
}
return 0;
}
Output 1
Enter value of a: 44
Enter value of b: 11
Quotient = 4
Output 2
Enter value of a: 13
Enter value of b: 0
Cannot Divide. Divide By 0 Error