Print Cube

The program must accept a number and print it’s cube.

Example Input/Output 1:
Input:
5

Output:
125

Example Input/Output 2:
Input:
3

Output:
27

Python

N = int(input())
print(N*N*N) 

Java

import java.util.*;
public class Hello {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.print(N * N * N);
    }
}

C

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int N;
    scanf("%d",&N);
    printf("%d",N*N*N);
}

C++

#include <iostream>
using namespace std;
int main()
{
    int N;
    cin >> N;
    cout << N*N*N;
    return 0;
}
Previous Article

Nearest Integer - Factor

Next Article

Multiply by 2

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *