94身心/程式語言 - 考試
By Genevieve
at 2013-03-22T23:21
at 2013-03-22T23:21
Table of Contents
三、有一個程式如下圖所示,請回答下列問題:(30 分)
procedure confuse( x, y, z);
begin
y = y + 1;
z = z + x;
end;
begin
a = 2;
b = 3;
confuse ( a+b, a, a);
print a
end
(1)如果參數是以 Call by Reference(Address)傳遞,試繪出參數傳遞圖解,並計算
輸出為多少?
(2)如果參數是以 Call by Value 傳遞,試繪出參數傳遞圖解,並計算輸出為多少?
(3)如果參數是以 Call by Name 傳遞,試繪出參數傳遞圖解,並計算輸出為多少?
對個答案
(1):輸出8
(2):輸出2
(3):輸出9
不知道對不對
--
procedure confuse( x, y, z);
begin
y = y + 1;
z = z + x;
end;
begin
a = 2;
b = 3;
confuse ( a+b, a, a);
print a
end
(1)如果參數是以 Call by Reference(Address)傳遞,試繪出參數傳遞圖解,並計算
輸出為多少?
(2)如果參數是以 Call by Value 傳遞,試繪出參數傳遞圖解,並計算輸出為多少?
(3)如果參數是以 Call by Name 傳遞,試繪出參數傳遞圖解,並計算輸出為多少?
對個答案
(1):輸出8
(2):輸出2
(3):輸出9
不知道對不對
--
Tags:
考試
All Comments
By Isla
at 2013-03-23T11:01
at 2013-03-23T11:01
By Agatha
at 2013-03-26T11:49
at 2013-03-26T11:49
By Leila
at 2013-03-27T11:46
at 2013-03-27T11:46
By Tracy
at 2013-03-28T09:30
at 2013-03-28T09:30
By Mia
at 2013-03-30T01:56
at 2013-03-30T01:56
Related Posts
地特三等勞工行政錄取分數
By Daph Bay
at 2013-03-22T23:15
at 2013-03-22T23:15
關於100年刑法 撲馬的課程
By Dorothy
at 2013-03-22T23:08
at 2013-03-22T23:08
請問有推薦中國內政,組織法規和法律的書?
By Franklin
at 2013-03-22T23:07
at 2013-03-22T23:07
請教101會計師選擇題問題
By Victoria
at 2013-03-22T21:37
at 2013-03-22T21:37
肌腱原理 問題
By Sierra Rose
at 2013-03-22T21:23
at 2013-03-22T21:23