+ 3

PseudoCode

Does the last iteration "count" in pseudo code? I mean, in a loop for, with a step =1, is " i " going from 1 to n"? Does the n-value count? Or does it stop at "n-1" like in the python language? Sorry If it's not clear

30th Dec 2019, 2:07 PM
Suzanne
Suzanne - avatar
5 odpowiedzi
+ 5
I doubt there's just one set of rules for writing pseudo code. The meaning of pseudo code is mostly to fix an idea on paper without writing too much. In cases where it's important, I'd likely write the -1.
30th Dec 2019, 2:28 PM
HonFu
HonFu - avatar
+ 1
Thanks to both of you. As there is no convention it's interesting to be aware of what people think of the situation
30th Dec 2019, 4:53 PM
Suzanne
Suzanne - avatar
0
Hi
19th Feb 2022, 12:42 PM
smita bhuse
smita bhuse - avatar
0
initialize char c set c= a print "%d",a
19th Feb 2022, 12:43 PM
smita bhuse
smita bhuse - avatar