you don't need to include cmath for this program, but if you do want to want to then it should be on another line
1 2
#include <iostream>
#include <cmath>
Your problem is probably just that the window disappears before you get a chance to take a look at the output. Check this thread out for ways to pause the console window http://cplusplus.com/forum/beginner/1988/