int and double

what do int and double mean exactly.
int = integer.

Eg. int x = 3 (means x is an integer and x is assigned an integer value of 3)

double = decimal

Eg. double x = 3.111 (means x is a decimal value and x is assgined a value of 3.111)
So what is float?

And how come in an example I see things such as

cout << "enter a fahrenheit: "
double fahrenheit;
cin >> fahrenheit;

is the double there assuming the user will input a decimal number?
Thanks so much!
Float is like double, it uses decimals, except it is smaller in the number that it can take. Also, yes in your example, it is set to double Fahrenheit because the user may put in something like "98.8" degrees fahrenheit.
great, also a question about the pow function.
If I am using A^b power in an equation do i do pow(a,b) or pow(b,a)?
Why not try each one and see which works?

1
2
3
4
5
6
7
8
9
10
11
12
13
//pow (a, b)
#include <iostream>
#include <cmath.h>
using namespace std;

int main ()
{
    int a, b;
    cin>> a;
    cin>> b;
    cout<< pow (a, b)<< endl;
    return 0;
}


 3
 2
 9


1
2
3
4
5
6
7
8
9
10
11
12
13
//pow (b, a)
#include <iostream>
#include <cmath.h>
using namespace std;

int main ()
{
    int a, b;
    cin>> a;
    cin>> b;
    cout<< pow (b, a)<< endl;
    return 0;
}


 3
 2
 8


*POOF* The answer is pow (val, topowofval2);// ab = pow (a, b)
Topic archived. No new replies allowed.