Computer Science, asked by ng437704, 1 year ago

c++code for 2 22 222 2222 22222

Answers

Answered by RawatPahadi
0

Explanation:

sum =[2+22+222+2222….]

sum= 2*[1+11+111+1111….]

Sum = 2/9[9+99+999+9999….]

sum= 2/9 [10+100+1000+10000+.....]

sum = 2/9[10+102+103+104+.....]

sum=2/9*[(10n-1-9n)/9

Mark me as Brainliest

Similar questions