A special site for solving fun programming problems and challenges, interested in computer science, programming, basics, data structure and algorithms

 

Find Quotient and Remainde

Write a C++ Program to Find Quotient and Remainder of 2 numbers. Here’s simple C++ Program to Find Quotient and Remainder of 2 numbers in C++ Programming Language.


  • In this program, user is asked to enter two integers (divisor and dividend) and computes the quotient and remainder.
  • To compute quotient and remainder, both divisor and dividend should be integers.                              

source code:

#include <iostream>

using namespace std;

int main()
{
    int A,B;
    cout<<"Enter the first number: ";
    cin>>A;
    cout<<"\nEnter the second number: ";
    cin>>B;
    cout<<"\nQuotient is: "<<A/B<<endl;
    cout<<"\nRemainder is: "<<A%B<<endl;

    return 0;
}


No comments:

Post a Comment