Basic code in C++ for division would be:
int a = 2;
int b = 2;
int c = a / b;
A more advanced application would be to allow the user to specify the variables:
#include <iOStream>
int num1;
int num2;
std::cout << "What is the first number?";
std::cin >> num1;
std::cout << "What is the second number?";
std::cin >> num2;
std::cout << num1 / num2 << endl;
This program will not account for variables which are entered other than integers.
Copyright © 2026 eLLeNow.com All Rights Reserved.