Disadvantages Of Pseudo Codes

Pseudo codes can sometimes become very lengthy for long and complex programs which can consume a lot of space.

342.
Example Of A Pseudo Code
Write a pseudo code to find out the sum of first 100 natural numbers.
Sum = 1+2+3+4…………+99+100.

Solution-
1. Initialize the Variable for sum
S=0;
2. Initialize the Variable N for the terms,
N=0;
3. Incrementing the Variable N;
N=N+1;
4. Adding the terms to the Variable for Sum;
S=S+N;
5. IF N=100, go to step 6
ELSE, go to step 3.
END ELSE IF
6. PRINT “The sum of first 100 natural numbers is”;
PRINT S;
7. END

© 2020 customphdthesis.com. All Rights Reserved. | Disclaimer: for assistance purposes only. These custom papers should be used with proper reference.