Given a first element ** a** and common difference

**of an arithmetic progression. Write a program to find the nth term in that progression.**

*d***Example: **

a = 1, d = 2, n = 5 output: 9 a = 2, d = 5, n = 4 output: 17

**Solution: **

**Formula for finding nth term in an arithmetic progression:**

Nth term = a + (n-1)*d.

**Code:**

**Output:**

a = 1, d = 2, n = 5 5th term: 9 a = 2, d = 5, n = 4 4th term: 17