A few comments:
You do not need to declare the following in your output function. Remove it, it will make it easier to read.
1 2 3 4
|
double rad = 0;
double hei = 0;
double vol = 0;
double are = 0;
|
You do not use the following in your main(). Remove them
1 2
|
double radius;
double height;
|
double sla
is declared and used, but you never set it! This will return garbage. I assume that in your area calculation, you meant to use hei. Remove double sla and all references to it from the code or set it.
You use
cin >> hei
but you never declare hei. perhaps this was meant to be sla. Set something meaningful and remove hei or declare hei and use it.
you set the variable "area" but you do not declare it or use it as an argument in output(). I assume this is a typo and that you mean to use "are".
You declare and use "pi", but it is not set to anything! Make sure you initialize its value or it will get some junk that was in memory prior to you creating this variable.
I know sla and pi are set in the global scope (not in any functions), but I believe you are overwriting that when you declare them locally (inside a function). Remove all global definitions. It's generally a good idea.
you set r = pow(rad,2) then use r only once. That's unnessesary. From here I get finiky. Remove that line and replace the area calculation with the one below:
are = (pi * rad * rad) + (pi * rad * sla);
much easier!
Finally: Please use code tags! That helps us to read your code on this site.
Phew, that was quite a bit.