67 035
Assignments Done
99,3%
Successfully Done
In November 2018

Answer to Question #5716 in C++ for haruna

Question #5716
write a program that declares two integers and initializes them to 199 and 76. display the sum, difference, product, average, square, and remainder of the values
Expert's answer
# include <iostream>
# include <math.h>


using namespace std;


int main()
{
int num1 = 199, num2 = 76;
int sum = num1 + num2;
cout<<"sum = "<<sum<<endl;
int dif = num1 - num2;
cout<<"dif = "<<dif<<endl;
int prod = num1*num2;
cout<<"prod = "<<prod<<endl;
double aver = (num1 + num2)/2;
cout<<"aver = "<<aver<<endl;
int sqr1 = num1*num1;
cout<<"square1 = "<<sqr1<<endl;
int sqr2 = num2*num2;
cout<<"square2 = "<<sqr2<<endl;
int rem = num1%num2;
cout<<"reminder = "<<rem<<endl;


system ("Pause");
return 0;
}



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions