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