ADA Programing Language Question?

Can someone post the code for a simple ADA program. It would ask for two numbers and then add those numbers and show the answer. I am using a lunix vi to edit it by the way and GANT to compile it.


Sorry ment GNAT bad

1 Answer

  • 10 years ago
    Favorite Answer

    My ada is abyssmal and this compiles without error on GNAT but doesn't run. What is GANT by the way?

    EDIT: Got it to compile and run. It was my bad of course. It does run. I just left out the step gnatbind.

    with Ada.Text_IO, Ada.Integer_Text_IO;

    use Ada.Text_IO, Ada.Integer_Text_IO;

    procedure Addit is

    a: INTEGER;

    b: INTEGER;

    c: INTEGER;




    Put ("Enter a number:");

    Get (a);

    Put ("Enter another number:");

    Get (b);

    c := a + b;

    Put ("You entered");


    Put (" and ");


    Put (" which together make ");

    Put (c);

    end Addit;

Still have questions? Get your answers by asking now.