with Ada.Text_IO; use Ada.Text_IO; procedure Add is X : integer := 0;Y : integer := 1; begin for I in 1..3 loop for J in 1..I loop X := X + Y + J; end loop; Y := X; end loop; return X; end Add
Standard input is empty
gnatgcc -c -pipe -O2 prog.adb prog.adb:4:11: warning: file name does not match unit name, should be "add.adb" prog.adb:19:01: procedure cannot return value (use function) prog.adb:21:08: missing ";" gnatmake: "prog.adb" compilation error
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!