fork download
  1. with Ada.Text_IO; use Ada.Text_IO;
  2. with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
  3.  
  4. procedure Add_Numbers is
  5. A, B, Sum : Integer;
  6. begin
  7. Put("Enter A: ");
  8. Flush;
  9. Get(A);
  10. Put_Line("");
  11.  
  12. Put("Enter B: ");
  13. Flush;
  14. Get(B);
  15. Put_Line("");
  16.  
  17. Sum := A + B;
  18.  
  19. -- Print output in requested format
  20. Put(Integer'Image(A));
  21. Put(" + ");
  22. Put(Integer'Image(B));
  23. Put(" = ");
  24. Put_Line(Integer'Image(Sum));
  25. end Add_Numbers;
Success #stdin #stdout 0.01s 5292KB
stdin
5
5
stdout
Enter A: 
Enter B: 
 5 +  5 =  10