with Ada.Text_IO, Ada.Integer_Text_IO;
use Ada.Text_IO, Ada.Integer_Text_IO;
procedure factorial_ada is
n, i : Integer;
output : Integer := 1;
begin
Put_Line("Enter the number to be taken factorial of: ");
Get(n);
-- Begin Loop
for i in 2..n
loop
output := output * i;
end loop;
Put("Factorial of ");
Put(n);
Put(" is ");
Put(output);
end factorial_ada;
My code compiles and works but I"m getting a warning which says "variable "i" is never read and never assigned" "for loop implicitly declares loop variable" "declaration hides "i" declared at line 15"
How do I fix this?