CS
cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
This was created to answer the following posted question:
https://www.sololearn.com/Discuss/1602860/?ref=app
WARNING: This will sometimes show a compilation error on Code Playground.
**************************
This will run on:
https://dotnetfiddle.net/WYXUlg
(using Roslyn 2.0)
**************************
*/
using System;
using System.Linq;
using System.Collections.Generic;
public static class ArithmeticProgression
{
public static List<int> GetTerms(int start, int step, int term_count){
var terms = new List<int>();
var next_term = start;
do
{
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run