Write a program using Java language to generate the cube of a given number.
Answers
Answered by
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
English,
2 months ago
Social Sciences,
2 months ago
World Languages,
2 months ago
Math,
5 months ago
English,
5 months ago
Math,
11 months ago
Social Sciences,
11 months ago
Science,
11 months ago