worked ok for me on Vista using VC++ 2005 Express. If you are using *nix maybe it does not have a pause shell command ???
Ancient Dragon
Retired & Loving It
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
Its not the compiler -- your program contains a bug line 13 -- change the data type to float and it will probably work as expected.
Ancient Dragon
Retired & Loving It
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
Its always a good practice not to ignore warnings which appear when you compile your code. A warning about 'converting from float to int' would have given you the reason why your program is not working.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 733