Computer Science, asked by kanupriyaraina, 5 months ago

you are given first three enteries of an arithmetic progression. You have to calculate the common difference and print it.​

Answers

Answered by sayammalik751
3

Explanation:

Here

T1

T2

T3

now T2-T1 = 2-1 = 1

T3 -T2= 3-2=1

Hence the common difference (d) is =1

Answered by resanity
0

Answer:

Psudo-code because I don't know which programming language you want...

// Given integers a, b, c

// Calculate the difference between a and b. (b-a)

// Compare that difference to the one between b and c. (c-b\\)

// If they are the same, return some error message

// If not print out b - a.

Explanation:

It doesn't really matter which two you do, as long as a, b, and c are valid arithmetic progression numbers (of the same set), you don't have to worry about the conditionals.

Similar questions