Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- float a;
- int n;
- float p;
- cout << "Enter a: ";
- cin >> a;
- cout << "Enter n: ";
- cin >> n;
- p = a;
- for (int i = 1; i < n; i++)
- {
- p *= (a + i);
- }
- cout << "P: " << p;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement