Guest User

Untitled

a guest
Jun 21st, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.     int n;
  7.     double x, a, b;
  8.     cout << "Enter N: "; cin >> n;
  9.     cout << "Enter X: "; cin >> x;
  10.     cout << "Enter A: "; cin >> a;
  11.     cout << "Enter B: "; cin >> b;
  12.     double q=1;
  13.     for (int i=1; i<=n; i++)
  14.         q*=(i*a+x)/(i*b+x);
  15.     cout << q;
  16.    
  17. }
Add Comment
Please, Sign In to add comment