SHARE
TWEET

Untitled

a guest Sep 20th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int n,amount;
  2. double x, s_x=0,y_x;
  3. cout << "Enter the number of row "<< endl;
  4. cin >> n;
  5. cout << "Enter the number of iterations  "<<endl;
  6. cin >> amount;
  7.  
  8. for(int i = 0; i<amount; i++){
  9.     s_x=0;
  10.     cout<<"Enter the number  "<<endl;
  11.     cin >> x;
  12.     if(x>1 || x<0.1){
  13.         cout<<"Invalid  ";
  14.         break;
  15.     }
  16.     y_x = pow((x*x/4 +x/2 +1),exp(x/2));
  17.     for(int j = 0; j<n; j++){
  18.         s_x += ((j*j +1)/fact(j))*(pow(x/2,j));
  19.     }
  20.     cout<<"S(x) = "<<s_x<<'\t'<<"Y(x) = "<<y_x<<endl;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top