Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1[C++] Math Empty [C++] Math Wed Oct 27, 2010 11:09 pm

des

des
Achiever
Loading
First you start off with your #includes.
Code:
#include <iostream>
#include <math.h>
Now after that, you add this.
Code:
using namespace std;
You always need that.
Now for the function(Main).
Code:
int main()
{
    int a, b, total;
a and b are going to be the numbers you want to be.
Now we add it.
Code:
cout << "Enter a number you want to add " << endl;
    cin >> a >> b;
Like again, a and b are the numbers you want. Now after that, here was we need to give us the answer.
Code:


total = a + b;
   
    cout << "The total sum is : " << total << endl; 
    system("PAUSE");
    return 0;
}
If I didn't explain good, feel free to pm me.

2[C++] Math Empty Re: [C++] Math Sun Jan 09, 2011 9:01 pm

OwenWilson

OwenWilson
Master
Loading
that makes sense i guess
:o
thanks desu!
Smile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Related topics

Permissions in this forum:
You cannot reply to topics in this forum