C Program to find the sum upto n-th even integers
write(*,*)'Enter the limit:'
read(*,*)n
write(*,*)'The even integers between 0 and',n,' are :'
sum=0
do i=2,n,2
write(*,*)i
sum=sum+i
end do
write(*,*) 'The sum of these even numbers are',sum
end
write(*,*)'Enter the limit:'
read(*,*)n
write(*,*)'The even integers between 0 and',n,' are :'
sum=0
do i=2,n,2
write(*,*)i
sum=sum+i
end do
write(*,*) 'The sum of these even numbers are',sum
end
Comments
Post a Comment