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