






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Examples on series by using fortran 90
Typology: Quizzes
1 / 12
This page cannot be seen from the preview
Don't miss anything!







!solution
real s,a,b,c,d
s=
do i=1,
a=(2*i)-
b=2*i
c=a+
d=b+
s=s+((ac)/ (bd))
end do
print*,'s=',s
!solution
real a
print*,
do i=1,
if(mod(i,2)==0)then
a=2*i
else
a=(2*i)-
end if
print*,a
end do
2 4 6 8
real a,b,c,i,fact,k,x,q
q=
a=
b=
k=
read*,x
do i=1,
c=2*i
fact=
do j=1,i
fact=fact*j
end do
q=q+(k(xc)/(afact*fact))
a=a+b
b=b+
k=k*-
end do
print*,'q=',q
....... 2! 4! 6! 8!
( ) 1
2 4 6 8
X X X X COS X
real::m,x,j,k,s
s=
m=
x=
k=
print*,'cosx=',s
do i=1,
fact=
do j=1,m
fact=fact*j
end do
s=s-((x*m)/(fact)k)
k=k*(-1)
m=m+
end do
print*,'cosx=',s
....... 20!
7 65
12!
5 37
6!
3 17
2!
5
x x x x S
real (kind=8)::s
real m,r,x,k,c,i,s1,s2,s
s=3.
r=
k=-
c=
i=
read*,x
print*,s
do
m=(i**2)-i
fact=
do j=1,m
fact=fact*j
end do
f=i-
s2=r*x
s3=(c((R2)+(4f)))
s1=((s2+s3)/fact)*k
s=s+s
k=k*(-1)
c=c*(-1)
r=r+
i=i+
end do
print*,'s=',s
end
integer odd,even
even=
odd=
do i=0,
if(mod(i,2)==0)then
even=even+i
else
odd=odd+i
end if
end do
print*,'sum of odd numbers=',odd
print*,'sum of even numbers=',even
real::f
do i=1,
do j=1,
f=i*j
print*,f
end do
end do
2 3 4
x x x x Q
real x,fact,m,q,q
q=
k=
m=
read*,n,x
do i=1,n
m=i+
fact=
do j=1,m
fact=fact*j
end do
q1=(k(x*i)/fact)
q=q+q
k=k*(-1)
end do
print*,'q=',q