Forum Kuliah UAD
Would you like to react to this message? Create an account in a few clicks or log in to continue.

tugas sinung abimana

Go down

tugas sinung abimana Empty tugas sinung abimana

Post  Ganys Ika Nilasari Thu Jun 27, 2013 10:03 am

Tugas Pemrograman Komputer
Nama : Sinung Abimana / NIM : 11006130 / Kelas : C


Langkah 1
x = 2 ....................global
y = 5 ....................global

coba 1 (3)
a = 3 disubstitusikan ke procedure coba 1 (a:integer)

x = a + 5
= 3 + 5
= 8 .....................lokal

y = x * 2
= 8 * 2
= 16 .................global karena tidak terdapat pada variabel procedure

Langkah 2
coba 2 (-3)
b = -3 disubstitusikan ke procedure coba 2 (b:integer)

x = b * 2
= -3 * 2
= -6 ..................global

y = x + y
= -6 + 16
= 10 ...................lokal

coba 1 (y) = coba 1 (10) disubstitusikan ke procedure coba 1

x = a + 5
= 10 + 5
= 15 ....................lokal

y = x * 2
= 15 * 2
= 30 ..................global

Kesimpulan :
x = -6 dan y = 30 adalah global terakhir





Ganys Ika Nilasari
Ganys Ika Nilasari

Jumlah posting : 8
Join date : 19.03.13
Age : 31
Lokasi : Yogyakarta

Kembali Ke Atas Go down

Kembali Ke Atas

- Similar topics

 
Permissions in this forum:
Anda tidak dapat menjawab topik