A simple math program I wrote that performs addition, subtraction, multiplication, and division using two numbers that you input.
Screenshot of Program:
http://i.imgur.com/ARa6V.png
Raw Code:
#include<iostream>
using namespace std;
int main()
{
float num1;
float num2;
//Intro for program
cout<<"\n**SIMPLE MATH**\n\nWritten by Sam Devanski for C++ class\n\n";
cout<< "Welcome to my simple math program.\nThis program will perform various mathematical operations using two numbers that you input.\n";
//Prompts for input numbers
cout<<"\nPlease type your first number.\n";
cin>>num1;
cout<<"\nPlease enter your second number\n";
cin>>num2;
//Restates the numbers that you typed
cout<<"\nYour two numbers are "<<num1<<" and "<<num2<<".\n\n";
//Displays solutions to +,-,*,/ operations using your input numbers
cout<<num1<<" plus "<<num2<<" equals "<<num1+num2<<"\n";
cout<<num1<<" minus "<<num2<<" equals " <<num1-num2<<"\n";
cout<<num1<<" times "<<num2<<" equals " <<num1*num2<<"\n";
cout<<num1<<" divided by "<<num2<<" equals " <<num1/num2<<"\n";
cout<<"\n\nPress any key and then ENTER to exit.\n";
cin >> num1;
return 0;