Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n,amount;
- double x, s_x=0,y_x;
- cout << "Enter the number of row "<< endl;
- cin >> n;
- cout << "Enter the number of iterations "<<endl;
- cin >> amount;
- for(int i = 0; i<amount; i++){
- s_x=0;
- cout<<"Enter the number "<<endl;
- cin >> x;
- if(x>1 || x<0.1){
- cout<<"Invalid ";
- break;
- }
- y_x = pow((x*x/4 +x/2 +1),exp(x/2));
- for(int j = 0; j<n; j++){
- s_x += ((j*j +1)/fact(j))*(pow(x/2,j));
- }
- cout<<"S(x) = "<<s_x<<'\t'<<"Y(x) = "<<y_x<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement