Sunday, September 5, 2010

C++ Program to find the sum, difference, product and quotient of two integers.

#include
#include

void main()
{
clrscr();
int x = 10;
int y = 2;
int sum, difference, product, quotient, remainder;
sum = x + y;
difference = x - y;
product = x * y;
quotient = x / y;
remainder = x%y;
cout << "The sum of " << x << " & " << y << " is " << sum << "." << endl;
cout << "The difference of " << x << " & " << "y << is " << difference << "." << endl;
cout << "The product of " << x << " & " << y << " is " << product << "." << endl;
cout << "The quotient of " << x << " & " << y << " is " << quotient << "." << endl;
cout << "The remainder of " << x << " & " << y << " is " << remainder << "." << endl;
cout << "For more C++ Programs Visit ProudEngineers.com" << endl;
getch();
}

0 comments:

Post a Comment