what's the difference between flow chart and structure diagrams and pseudo code
with a pipe
Here's a simple pseudo code to find the highest of ten numbers entered by the user: initialize maxNumber to -infinity for i from 1 to 10 do read number if number > maxNumber then maxNumber = number end for print maxNumber This code initializes a variable to hold the maximum value, iterates through ten user inputs, and updates the maximum value whenever a larger number is found. Finally, it outputs the highest number.
no, you cant. it only works on string
Something like this: sum = 0 for i = 2 to 20 step 2 { sum = sum + i }
P. L. Hammer has written: 'Pseudo-Boolean programming and applications' -- subject(s): Algebra, Boolean, Boolean Algebra, Congresses, Programming (Mathematics)
A. W. Colijn has written: 'Pseudo-Boolean programming'
Pseudo code cannot be processed by a machine, it is solely intended for processing by humans.
flag
Begin Read num for(i=2; i<num; i++) if(num%2==0) then print "the number is not a prime no."; else if print "the number is prime"; end if Stop
It sounds like you're using Java, so instead of pseudo-code, I'll give you the actual code. LinkedList<Integer> l; // Let's assume you have a bunch of Integer values in this list. for (int i = 0; i < l.size(); i++){ int n = l.get(i); boolean prime = true; for (int i = 2; i < n; i++){ if (n % i == 0){ prime = false; break; } } if (prime){ l.remove(i); i--; } }
It doesn't. Pseudo code isn't a programming language, it is just there to give an idea of how you could write a program.
what's the difference between flow chart and structure diagrams and pseudo code
No. There is no "right way" and "wrong way" of writing pseudo code, let alone qualifying with "absolute". However, a pseudo code is "wrong" if it cannot be understood, or it is incorrect in semantic (what the code tries to describe, solve, etc)
Pseudo code does not have key words, you make it up, that's why it is pseudo.
pseudo code algorithm to create a linked list
In Java, such a data type is called boolean. In other programming languages it may be known by different names, including variations of "boolean" such as "bool", and "logical".