9: Write a program to calculate the sum of the following series (1+2+3………………….+100 )
integer i,sum
sum=0
i=1
30 sum=sum+i
i=i+1
if(i.LE.100) GOTO 30
write(*,*)'Sum
of series = ',sum
stop
end
10: Write
a program to calculate the sum of the following series (1+3+5…………….97+99 )
integer
i,sum
sum=0
i=1
30 sum=sum+i
i=i+2
if(i.LE.99)GOTO 30
write(*,*)'Sum of series = ',sum
stop
end
0 Comments