blob: 45318111f3a7875bd6ea1a7278454d4276962fd7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
//chapter 1 Ex 33
clc;
clear;
close;
//The given series is in geometric progression
a1=2; a2=2^2; n=10;
r=a2/a1;
Sum=a1*(r^n-1)/(r-1); //formula for GP
printf("The required sum is %d",Sum);
|