Cube of A Number in Javascript with Program, Algorithm, Flowchart, and Pseudocode
Cube of A Number in Javascript with Program, Algorithm, Flowchart, and Pseudocode
An algorithm is a procedure that allows a computer to solve any problem in a step by step manner.
Algorithm of the cube of a number
Here is the algorithm of a cube of a number
START
Step 1 → Enter any Number
Step 2 → Take integer variable num
Step 3 → Take integer variable cube
Step 4 → Multiply N three times
Step 5 → Display result as Cube
STOP
Pseudo code of Cube of Number
Here is the Pseudo code of a cube of a number
start
procedure
Varible num
cube ( num )
formula
cube = num * num * num
display cube
end procedure
Explanation
The number is anything that starts with 0-9
When we find a cube of any number we need to discuss some basic rules:
Require any same number not a random number because we are finding cube of a number so this is a rule that we need to discuss
Need a positive number
Not a negative number
So there are some basic rule
We just need a formula for finding the cube of a number and then display a result
Flowchart of a Cube of Number
Program of a Cube of Number
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<html> <head> <title> Cube of Number </title> <Script type="text/javascript"> var
n=parseInt(prompt("Enter Number:")); var cube; var cube=n*n*n; document.write("Cube of a Number = "+cube); </Script> </head> </html> |
Topic Covered
Cube of A Number in Javascript with Program, Algorithm, Flowchart, and Pseudocode.