Square & Cube
Lesson 4 of 32 in Coddy's Coding Problems course.
A power is the product of multiplying a number by itself. A power is always represented using a base number and an exponent. The base number tells us what numbers is being multiplied, while the exponent tells us how many times the base number is being multiplied.

Challenge
EasyGiven a natural number N from input. Calculate the square of that number (N2) and the cube of that number (N3). Output them divided by a single space.
In this challenge, create a program not a specific function, so you should also get the input using your preferred language.
Input
2
Output
4 8
Input
6
Output
36 216
Try it yourself
#include <stdio.h>
int main() {
// Write code here
return 0;
}
All lessons in Coding Problems
1Course Introduction
Introduction2Easy Difficulty
SumEven or OddSquare & CubeMonthsMiddle digitTriangleMathematicsSum to NSum of numbersSortingCircle