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.

Update:

Sorry ment GNAT lol...my bad

1 Answer

Relevance
  • 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;

    begin

    a:=0;

    b:=0;

    Put ("Enter a number:");

    Get (a);

    Put ("Enter another number:");

    Get (b);

    c := a + b;

    Put ("You entered");

    Put(a);

    Put (" and ");

    Put(b);

    Put (" which together make ");

    Put (c);

    end Addit;

    • Login to reply the answers
Still have questions? Get your answers by asking now.