What is Pseudocode?pseudocode is the plain English representation of a computer program or algorithm, which specifies the flow and operation of the program.It is generally used to represent the structural flow of a program, and it is not associated with any specific programming language.
The same quality makes it a perfect tool to represent algorithms for various problems.ExampleCode to check if the user entered number is odd or even:C++ Programmingint main()
Arithmetic Operator:+,-, *, /, MOD(%)4.
Logical Operator:AND, NOT and OR5.
Sum, Product:Σ ΠSpecial Keyword:START: To begin the pseudocode.INPUT: Take input from the user.PRINT: To print the output on the screen.READ/GET: Input format while reading data from the file.SET, INIT: Initialize a value.INCREMENT, BUMP: Increase the value of the variable, equivalent to a++.DECREMENT: Decrease the value of the variable, equivalent to a–.COMPUTE, CALCULATE, DETERMINE: To calculate the expression result.Conditional Statements:ifIF condition THEN if body ENDIFif…elseIF condition THEN if body ELSE else body ENDIFif…else if….elseIF condition statement THEN if body ELSE IF condition THEN else if statement ELSE else body ENDIFIterators:for loops:FOR initial_value TO end_value for body ENDFORExample:FOR i -> 0 to 20 PRINT i ENDFORwhile loopWHILE condition while body
ENDWHILEFizzBuzz Pseudocodenum : 1 FOR num -> 1 to 20 IF num MOD 15 ===0 PRINT “FizzBuzz” ELSE IF num MOD 3 ===0 PRINT “Fizz” ELSE IF num MOD 5===0 PRINT “Buzz” ELSE PRINT num ENDIF ENDFOREquivalent Python Code:for num in range(1, 21): if num % 15 ==0: print("FizzBuzz") elif num %3 ==0: print("Fizz") elif num %5==0: print("Buzz") else: print(num) Pseudocode to C++Now let’s convert the above pseudocode to the equivalent C++ code.#include