Your First Function

Lab C++ Beginner 10 points

Complete int cube(int x). The starter reads a number and prints cube(n).

Input

One integer.

Output

Its cube.

Example

Input

3

Output

27
Sample input available Sample output available
Editor
C++

Hints

return sends the result back to the caller.

Solution explanation

A function's return type is written before its name.

Show solution
#include <iostream>
using namespace std;

int cube(int x) {
    return x * x * x;
}

int main() {
    int n;
    cin >> n;
    cout << cube(n) << "\n";
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD