program main
integer::i,n,sum
write(*,*)"Enter the value of n:"
read(*,*)n
sum=0
do i=1,n
sum=sum+i
end do
write(*,*)"The sum is;",sum
end program main

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: