+ 2

Question

2.Design a program or code which will find the number of nth term in arithmetic progression

5th Apr 2017, 9:45 PM
Faridi Adidi Sadick
Faridi Adidi Sadick - avatar
2 Answers
+ 16
AP(nth term) = a + (n-1)d, where a is first term and d is arithmetic difference, if I'm not mistaken.
6th Apr 2017, 12:12 AM
Hatsy Rei
Hatsy Rei - avatar
+ 15
int n; cin >> n; cout << getTerm(n); // The getTerm method will depend on what arithmetic progression you are using
5th Apr 2017, 10:46 PM
Jafca
Jafca - avatar