Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
program prob4
!10 nmbrs frm the user and print their sum and product
integer :: i,s,p,a
s=0
p=1
do i=1,10
read *, a
s=s+a
p=p*a
end do
print *, 'sum s=' ,s
print *, 'product p=' ,p
end program prob4
program ex4
!this prgm print sum and product
integer::i,s,p,a
s=0
p=1
do i=1,10
read*,a
s=s+a
p=p*a
end do
print*, 's=',s
print*,'p=' ,p
end program ex4
program prob3
!this program calc all number between low and high that are divisible by number
integer::i,s,n,low,high
read*,low,high,n
do i=low,high
s=mod(i,n)
if(s==0)then
print*,i
end if
end do
end program prob3
program prob3
! print all number between LOW and HIGH that are divisible by NUMBER
integer :: i,low,high,n,s
read *, low,high,n
do i=low,high
s=mod(i,n)
if(s==0) then
print *, i
end if
end do
end program prob3
program ex2
!this program calculates sum of numbers from low to high
integer::i,s,low,high
read *, low,high
s=0
do i=low,high
s=s+i
end do
print*,'low number is', low
print*,'high number is', high
print*,'sum from low to high',s
end program ex2