Computer Science, asked by parasjaiswal44, 5 months ago

Write a program using Java language to generate the cube of a given number.​

Answers

Answered by aayushimishra201
2

Answer:

import java.util.Scanner;

public class FindingCube {

public static void main(String args[]){

int n = 5;

System.out.println("Enter a number ::");

Scanner sc = new Scanner(System.in);

int num = sc.nextInt();

System.out.println("Cube of the given number is "+(num*num* num)

Enter a number ::

5

Cube of the given number is 125.

Similar questions