Write a C++ program which reads values for two floats and outputs their sum, product and quotient. Include a sensible input prompt and informative output.
1
Expert's answer
2013-07-16T09:52:59-0400
#include <iostream>
using namespace std;
int main(){ float a, b; cout << "Input two numbers: "; cin >> a >> b;
cout << "Sum is: " << a + b << endl; cout << "Product is: " << a * b << endl; if( b != 0 ) cout << "Quotient is: " << a / b << endl; else cout << "Division by zero" << endl;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment