471,620 Members | 1,242 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,620 software developers and data experts.

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 8427

"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 XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.