C Program to find the sum of first n numbers
write(*,*)'Enter the desired limit:'
read(*,*)n
write(*,*)'The numbers are:'
sum=0.0
do i=1,n
write(*,*)i
sum=sum+i
end do
write(*,*)'The sum of the numbers is :',sum
end
write(*,*)'Enter the desired limit:'
read(*,*)n
write(*,*)'The numbers are:'
sum=0.0
do i=1,n
write(*,*)i
sum=sum+i
end do
write(*,*)'The sum of the numbers is :',sum
end
Comments
Post a Comment