Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int a, n, r, term;
- cout << "Enter the First Term (a) : ";
- cin >> a;
- cout << "Enter the Common Ratio (r) : ";
- cin >> r;
- cout << "Enter the Number of terms (n) : ";
- cin >> n;
- cout << "The Geometric Progression is :-" << endl;
- term = a;
- cout << term << endl;
- for (int i=1; i<n; i++){
- term *= r;
- cout << term << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement