Even Odd in Ada

Published on 10 May 2026 (Updated: 10 May 2026)

Welcome to the Even Odd in Ada page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

with Ada.Text_IO;      use Ada.Text_IO;
with Ada.Command_Line; use Ada.Command_Line;

procedure Even_Odd is

   procedure Print_Usage is
   begin
      Put_Line ("Usage: please input a number");
   end Print_Usage;

begin
   if Argument_Count /= 1 then
      Print_Usage;
      return;
   end if;

   declare
      Value : Integer;
   begin
      Value := Integer'Value (Argument (1));
      Put_Line (if Value rem 2 = 0 then "Even" else "Odd");

   exception
      when Constraint_Error =>
         Print_Usage;
   end;

end Even_Odd;

Even Odd in Ada was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.