so according to your hints i think the type of the argument of cos is ambiguous . |
What I meant was, what is the type
expected by the cos maths library function. You really shouldn't use functions without finding out how they work.
I think you are confused about different variable types and how they work.
type of "i" is int and the type of "x" is char c++ converts their multiplication into an int type. |
A char is really a small int that happens to represent a char. So when i is multiply by x (which isn't set to anything) the answer is an int, but then the compiler converts this to the another type, which is what the cos function is expecting.
The fact that x wasn't set, make me wonder how it even compiled, let alone run.
You are try to output some thing like :
[output]
2.0x 1.5x 1.33x
/output]
How you are doing it, is completely wrong. To print the x character, use the stream, not try to put it in the cos function.
But you need to sort out the cos function first. Another thing what is the value expected by the cos function - Hint: it's not degrees.