Untitled

 avatar
unknown
plain_text
2 years ago
566 B
5
Indexable
#include <iostream>
using namespace std;
double a, b, c;

void sum(double a, double b){
c = a + b;
cout << "Sum: " << c << endl;  
}

void diff(double a, double b){
  c = a - b;
  cout << "Difference: " << c << endl;
}

void product(double a, double b){
  c = a * b;
  cout << "Product: " << c << endl;
}

void division(double a, double b){
  c = a / b;
  cout << "Division: " << c << endl;
}

int main() {
  cout << "Enter 1st Number: ";
  cin >> a;
  cout << "Enter 2nd Number: ";
  cin >> b;
  sum(a,b);
  diff(a,b);
  product(a,b);
  division(a,b);
  return 0;
}
Editor is loading...