Script Fortran untuk norm tak hingga

· Fisika
Penulis

! norm tak hingga =  nilai mutlak maksimal dari matrik x

Program Norm tak hingga

Implicit None
Real :: x(10,10), nth, temp

Integer :: k
x(1,1) = 7

x(2,1) = -1

x(3,1) = 17

x(4,1) = 4

 

Write (*,*)

Write (*,*) ‘Vektor x’

Do k = 1,4

Write (*,*) x(k,1)

end do

 

Write (*,*)     !kalo yang ini agar nilai x jadi mutlak

do k = 1,4

if (x(k,1) .LT. 0) then

x(k,1) =  x(k,1) * -1

end if

write (*,*) x(k,1)

end do

write (*,*)

do k = 1,4

if (x(k,1) .LT. x(k+1 , 1))  then

temp = x (k+1,1)

end if

end do

nth = temp

Write (*,*) ‘norm tak hingga:’, temp

Stop

End Program Norm tak hingga

 

 

*) Semoga bermanfaat…

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: