Certainly! Here’s a simple C++ program to compute the quotient and remainder of two numbers using the Turbo C++ compiler:
#include <iostream.h>
#include <conio.h>
void main() {
clrscr(); // Clear screen function for Turbo C++
int dividend, divisor, quotient, remainder;
cout << "Enter dividend: ";
cin >> dividend;
cout << "Enter divisor: ";
cin >> divisor;
// Compute quotient and remainder
quotient = dividend / divisor;
remainder = dividend % divisor;
cout << "Quotient: " << quotient << endl;
cout << "Remainder: " << remainder;
getch(); // Wait for a key press in Turbo C++
}
To use this program in Turbo C++:
- Open Turbo C++.
- Create a new source file or open an existing one.
- Copy and paste the above code.
- Compile the program (usually by pressing
Alt + F9). - Run the compiled program (usually by pressing
Ctrl + F9). - Enter the dividend and divisor values to get the quotient and remainder.
