-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestcase8.txt
More file actions
40 lines (37 loc) · 820 Bytes
/
testcase8.txt
File metadata and controls
40 lines (37 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
%Test Case 1
%Following function computes the sum of user defined real numbers
%The variable d3 maintains the sum of values
_sumN input parameter list [int d5cc34]
output parameter list[real d3,int d2,real b5];
type int : b5b567;
type int : b5b567;
b5b567 <--- 1;
%d3 <--- 0.00;
while ( b5b567 <= d5cc34)
read( c3bd);
d3 <--- d3 + c3bd;
b5b567 <--- b5b567 + 1;
endwhile
return [d3];
end
_sumN input parameter list [int d5cc34,int b3]
output parameter list[real d3,int d2,real b5];
type int : b5b567;
type int : b5b57;
b5b567 <--- 1;
%d3 <--- 0.00;
while ( b5b567 <= d5cc34)
read( c3bd);
d3 <--- d3 + c3bd;
b5b567 <--- b5b567 + 1;
endwhile
return [d3];
end
_main
type int :b3;
type real :c4bd56;
b3 <--- 7;
[c4bd56]<--- call _sumN with parameters [b3];
write(c4bd56);
return;
end