I want to create a script that does the action: Enter first number then last number,And what is obtained is that for each number child, numbers from 1 to 3 will appear
first number=1
last number=2
What you get is this:
- 1 1
- 1 2
- 1 3
- 2 1
- 2 2
- 2 3
What I managed is this file
@echo off
set /p F=first number:
set /p L=last number:
setlocal ENABLEDELAYEDEXPANSION
FOR /L %%A IN (%F%,1,%L%) DO (
set /A result=%%A %% 3
echo %%A !result!
)
But the result is not good enough
CodePudding user response:
What you need are nested for
loops:
@echo off
set /p F=first number:
set /p L=last number:
setlocal ENABLEDELAYEDEXPANSION
FOR /L %%A IN (%F%,1,%L%) DO (
for /L %%B in (1,1,3) do (
echo %%A %%B
)
)