repeat statement

Purpose: This command executes the statements defined within its body “n” number of times where n is the number passed by the user.If no number is passed,loop is executed infinite number of times.

Status: Done.Nesting of loops is not supported at the moment.

Syntax:

   repeat [n]
   ...
   end

Let's see some examples of this command.

Example 1:

 repeat 3
 echo Hello World!!
 end

Output:

      gnucap> Hello World!!
              Hello World!!
              Hello World!!

Example 2:

repeat
echo This statements will run infinite times.
end

Output:

       gnucap>This statement will run infinite times.
              This statement will run infinite times.

and,this statement will continue executing……..infinite times!!