0% found this document useful (0 votes)
837 views

C++ Program To Find The Sum, Difference, Product and Quotient of Two Integers

This program defines integer values for x and y, calculates the sum, difference, product, and quotient of x and y, and outputs the results using cout. It performs basic arithmetic operations on two predefined integers and displays the output.

Uploaded by

Dhathri Pitta
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
837 views

C++ Program To Find The Sum, Difference, Product and Quotient of Two Integers

This program defines integer values for x and y, calculates the sum, difference, product, and quotient of x and y, and outputs the results using cout. It performs basic arithmetic operations on two predefined integers and displays the output.

Uploaded by

Dhathri Pitta
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <iostream.

h>
#include <conio.h>
void main()
{
clrscr();
int x = 10;
int y = 2;
int sum, difference, product, quotient;
sum = x + y;
difference = x - y;
product = x * y;
quotient = 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 << "." << en
dl;
cout << "The quotient of " << x << " & " << y << " is " << quotient << "." <<
endl;
getch();
}
This program has pre-defined values for two integers x and y.
The sum, difference, product and quotient of these two values are calculated and
then outputted using the 'cout' command.

You might also like