Solved please i need the ans

November 13, 2012 at 06:00:12
Specs: Windows XP

what is the general syntax of nested loop?

See More: please i need the ans

Report •


#1
November 13, 2012 at 08:17:42
✔ Best Answer

pseudocode:
while i<10 do
i=i+1
print "i:",i
while j<5 do
j=j+1
print "j",jj
loop (j)
loop (i)

or, in batch:
for %%i in (1,1,10) do (
echo i:%%i
for %%j in (1,1,5) do (
echo j:%%j
)
)


Report •

#2
November 13, 2012 at 10:20:08

IN C++

For (i=0,i<5.i++)
{
For(x=0,x<5,x++)
{
Do your stuff here
}
}

For Visual Basic

For i=0 to 5
For x=0 to 5
Do your stuff here
Next
Next

So you can see, there is no general Syntax. It varies depending on what programming language you are using, something you omitted to divulge.

And that is only For/Next loops. There are While and Do/While loops as well.

Stuart


Report •

#3
November 20, 2012 at 08:09:26

thanx but i needed for gw-basic

Report •

Related Solutions

#4
November 20, 2012 at 08:10:16

thanx f0 the help...:)

Report •

#5
November 20, 2012 at 08:10:43

thank al0t:)nbrane

Report •

#6
November 20, 2012 at 08:44:23

thanx but i needed for gw-basic

It is the same as Visual Basic

Stuart


Report •


Ask Question