I am a beginner in the C programming language. I was working on a problem and was trying to determine how to print a table of inverse powers. The output would be similar to what is below:
Number 1/Square 1/Cube 1/Quatric
1 1.0 1.0 1.0
2 0.25 0.125 0.0625
3 0.11 0.012 0.0041
etc...
Originally I thought to divide the number by it's cube to get the inverse square, the number by the quatric to get the inverse cube, etc...
This seems to work for the number 2, but seems to fall apart when I use the same logic with the number 3.
Any suggestions?
Thanks,
Alan
Number 1/Square 1/Cube 1/Quatric
1 1.0 1.0 1.0
2 0.25 0.125 0.0625
3 0.11 0.012 0.0041
etc...
Originally I thought to divide the number by it's cube to get the inverse square, the number by the quatric to get the inverse cube, etc...
This seems to work for the number 2, but seems to fall apart when I use the same logic with the number 3.
Any suggestions?
Thanks,
Alan