Menu



Java program for calculating cube of a number


Cube.java

import java.util.*;
public class Cube
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int num;
System.out.print("Enter an integer number: ");
num=sc.nextInt();
System.out.println("Cube of "+ num + " is: "+ Math.pow(num, 3));
}
}










Connection failed: SQLSTATE[28000] [1045] Access denied for user 'studentdb'@'localhost' (using password: YES)

Subscribe