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

Embed on website

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