Post: I made a calculator what do you guys think about it
05-12-2017, 04:28 PM #1
(adsbygoogle = window.adsbygoogle || []).push({});
    #include <iostream>
using namespace std;

int main(){
double a,b;
cout<< "enter a number man\n";
cin>>a;
cout<< "enter another number man\n";
cin>>b;

double multiplication=a*b;
double division=a/b;
double sum=a+b;
double subtraction=a-b;

cout<< "the multiplication of your numbers is "<<multiplication<<endl;
cout<< "the division your numbers is "<<division<<endl;
cout<< "the sum of your numbers is "<<sum<<endl;
cout<< "the subtraction of your numbers is "<<subtraction<<endl;

return 0;
}

05-15-2017, 08:44 AM #2
What if the user inputs characters instead of numbers?
Learn to sanitize your inputs Smile

Other than that, good for a start. Keep going.

The following user thanked theDaftDev for this useful post:

mudville209

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo