Find N values of X1 , X2 , ... Xn such that X1 < X2 < ... < XN and sin ( X1 ) < sin ( X2 ) < ... < sin ( XN ) | C ++ program for the above approach ; Function to print all such Xi s . t . all Xi and sin ( Xi ) are strictly increasing ; Till N becomes zero ; Find the value of sin ( ) using inbuilt function ; increment by 710 ; Driver Code ; Function Call
#include <bits/stdc++.h> NEW_LINE using namespace std ; void printSinX ( int N ) { int Xi = 0 ; int num = 1 ; while ( N -- ) { cout << " X " << num << " ▁ = ▁ " << Xi ; cout << " ▁ sin ( X " << num << " ) ▁ = ▁ " << fixed ; cout << setprecision ( 6 ) << sin ( Xi ) << endl ; num += 1 ; Xi += 710 ; } } int main ( ) { int N = 5 ; printSinX ( N ) ; return 0 ; }