The trouble is you think you have time. Your success depends on how you utilize your time.

C++ Program which takes three input from user and add, subtract, divide them and print them.

Write a C++ program which takes three input from user, Add, Subtract and Divide them and Print them.

#include<iostream>
using namespace std;
int main()
{ cout<<"www.moznum.blogspot.com"<<endl<<endl;

float x,y,z,sum,diff,product,div;
cout << "Please enter first number: ";
cin >>x;
cout << "Please enter second number: ";
cin >>y;
cout << "Please enter third number: ";
cin >>z;
sum = x+y+z;
diff = x-y-z;
product = x*y*z;
div = (x*z)/y;
cout <<endl<<endl<< "Sum of the numbers are " << sum <<endl;
cout << "Difference of the numbers are: " << diff <<endl;
cout << "Product of the numbers are: " << product <<endl;
cout << "Result of the division are: " << div <<endl;
return 0;
}

You can also search this topic by:

No comments:

Post a Comment