I graduated in 1990 in Electrical Engineering and since then I have been in university, doing research in the field of DSP. To me programming is more a tool than a job.
Ada (unfortunately seems that no syntax highlighting is available for Ada)
with Ada.Command_Line;
with Ada.Text_IO; use Ada.Text_IO;
use Ada;
procedure Fib is
Old : Natural := 1;
Older : Natural := 0;
Limit : Positive;
Tmp : Positive;
Bad_Command_Line : exception;
begin
if Command_Line.Argument_Count /= 1 Then
raise Bad_Command_Line;
end if;
Limit := Positive'Value (Command_Line.Argument (1));
for K in 1..Limit Loop
Put_Line (Standard_Error, Integer'Image (K) & ":" & Integer'Image(Old));
Tmp := Old + Older;
Older := Old;
Old := Tmp;
end loop;
exception
when Bad_Command_Line | Constraint_Error =>
Put_Line(Standard_Error,
"Usage : Please Input The Count of Fibonacci Numbers To Output");
Command_Line.Set_Exit_Status(Command_Line.Failure);
end Fib;
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Ada (unfortunately seems that no syntax highlighting is available for Ada)