โ Back to Functions
Question 245
Cube a Number
Cube a Number
Write a function int cube(int n) that returns n raised to the third power (n times n times n).
For cube(3) the program prints 27.Expected Output:
27
Topics:
Functions
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.