# include # include # include # include using namespace std; int main ( ) // // TRIG_TABLE prints out the sine and cosine of angles from 0 to 90 // degrees, by 5's. // // The SETW() function specifies that the following data should be // printed using the given number of spaces. This helps the data // to be printed out in columns that line up. Using SETW() requires // that we include . // { float angle; int i; float pi = 3.14159265; cout << "\n"; cout << " Deg Radians Sine Cosine\n"; cout << "\n"; for ( i = 0; i <= 90; i = i + 5 ) { angle = pi * ( i / 180.0 ); cout << " " << setw(2) << i << " " << setw(10) << angle << " " << setw(10) << sin ( angle ) << " " << setw(10) << cos ( angle ) << "\n"; } return 0; }