Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
- with Ada.Text_IO; use Ada.Text_IO;
- --Mata in fem heltal och summera dessa. Avänd underprogram och fält.
- procedure Upp1 is
- type Array_Int is
- array(1..5) of Integer;
- procedure Inmatning(A: out Array_Int) is
- begin
- Put("Mata in fem heltal: ");
- for I in 1..5 loop
- Get(A(I));
- end loop;
- Skip_Line;
- end Inmatning;
- procedure Summering(A: in Array_Int;Summan: out Integer) is
- begin
- Summan:=0;
- for E in 1..5 loop
- Summan:=A(E)+Summan;
- end loop;
- end Summering;
- X: Array_Int;
- Y: Integer;
- begin
- Inmatning(X);
- Summering(X,Y);
- Put("Suman blev: ");
- Put(Y,0);
- end Upp1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement