taking advice from norm is usually a good move.... just change two of ur variables to double at declaration because like he said ur results are getting truncated because int variables dont return...