views:

58

answers:

1

I have not much knowledge in batch file programming. I like to know the working of for loop mainly. For this i think a small sample program will be helpful to me. So i want a simple program to display the first 'n' natural numbers.Any help please...

+2  A: 

If you are talking about Windows batch programming here you have a natural numbers generator:

for /L %i IN (0,1,9) do @echo %i

Other helpful links to deal with files and so on:

If you are talking about GNU Linux/Unix bash scripting you can go to:

Hope that helps,

Ramon Araujo
Thanks for the earlier reply. /L stands for what? Please reply.
Sarika
Look at "FOR /?" for help. /L does a sequence from "start" to "end" in increments of "step". In this case, from 0 to 9 in steps of 1. Official syntax: "FOR /L %variable IN (start,step,end) DO command [command-parameters]"
Aaron D
@sarika: `/l` or `/L` is for *loop*. Easy, ah?
pipitas
thanks... comments closed
Sarika