468,753 Members | 1,124 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,753 developers. It's quick & easy.

Pseudocode For Statement


I need to use a for statement to write some pseudocode. I am not sure
how to actually write it - using a for loop. Could someone please give
me an example of what a for statment would look like in pseudocode?

Thankyou
--
Posted via http://dbforums.com
Nov 13 '05 #1
2 8280

"Krisitne" <me*********@dbforums.com> wrote in message
news:33****************@dbforums.com...

I need to use a for statement to write some pseudocode. I am not sure
how to actually write it - using a for loop. Could someone please give
me an example of what a for statment would look like in pseudocode?

for each doodaad
dosome stuff
end for
Nov 13 '05 #2

"Krisitne" <me*********@dbforums.com> wrote in message

I need to use a for statement to write some pseudocode. I am not sure
how to actually write it - using a for loop. Could someone please give
me an example of what a for statment would look like in pseudocode?

pseudocode is a specification of an algorithm which is designed to be human-
rather than machine- readable.

How you would specify a for loop depends on your human audience. If they are
experienced C programmers, you would probably use the C syntax. On the other
hand if they are beginning programmers who are just learning about loops,
you would write something like.

counter is called i;
set i to initial value (usually zero)

loop label here:
do_something, possibly using i;
change i, (usually, add 1 to it)

if a condition involving i is true (usually, is i < N)
jump to loop label

for loop ends here.
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by bearophileHUGS | last post: by
3 posts views Thread by Lobbo1 | last post: by
4 posts views Thread by Vusi | last post: by
6 posts views Thread by anijenni | last post: by
2 posts views Thread by Joah Senegal | last post: by
7 posts views Thread by popeyerayaz | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.