Commit 93cecb2
committed
feat: Generate arithmetic progression series up to n terms
🧠 Logic:
- Read first term `a`, common difference `d`, and number of terms `n`.
- Initialize `term` with `a`.
- Use a loop running `n` times:
- Print current `term`
- Update `term = term + d` to get the next AP value.
Signed-off-by: Somesh diwan <[email protected]>1 parent f4647c0 commit 93cecb2
1 file changed
+1
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | | - | |
20 | | - | |
| 17 | + | |
21 | 18 | | |
22 | | - | |
23 | 19 | | |
24 | 20 | | |
25 | 21 | | |
| |||
0 commit comments