fork download
  1.  
  2. with Ada.Text_IO; use Ada.Text_IO;
  3.  
  4. procedure Add is
  5.  
  6. X : integer := 0;
  7. Y : integer := 1;
  8.  
  9. begin
  10.  
  11.  
  12. for I in 1..3 loop
  13. for J in 1..I loop
  14. X := X + Y + J;
  15. end loop;
  16. Y := X;
  17. end loop;
  18.  
  19. return X;
  20.  
  21. end Add
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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
stdout
Standard output is empty