Get output from array in Ada
18 June 2022 at 08:13
I want to print array data user input. But it give me error. I need to get input from user and store in the array. After this i want to print it also count each duplicate word.
with Ada.Text_IO;
use Ada.Text_IO;
procedure Main is
type String_Val is array (1 .. 100) of Character;
type Int_Val is array (1 .. 100) of Integer;
Data : String_Val;
begin
Put_Line ("Please enter values (use space as seperator)");
for I in 1..String_Val'Length loop
Data(I) := Character'Value(Get_Line);
end loop;
for I in String_Val'Range loop
Put (String_Val (Data));
end loop;
end Main;