![]() |
Program to enter two integers and print the quotient and remainder 1 Attachment(s) Program to enter two integers and print the quotient and remainder #include #include int main() { clrscr(); int x,y,quotient,remainder; cout << "Enter 2 integers greater than 0 : "; cin>>x>>y; quotient=x/y; remainder=x-(quotient*y); cout << "Quotient of " << x << " & " << y << " = " << quotient << "\n"; cout << "Remainder" << " = " << remainder << "\n"; getch(); return 0; } It then calculates their quotient and remainder and outputs them using the 'cout' command. Sample Input23 4 Sample Output Quotient of 23 & 4 = 5 Remainder = 3 |
| All times are GMT +5. The time now is 10:08 PM. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.