A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
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.
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.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.