-
-
Save deven9229/2b4ff10a8a1af9aebda15ea81baecd90 to your computer and use it in GitHub Desktop.
Write a program in Java to display the cube of the number upto given an integer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.deven; | |
import java.util.Scanner; | |
public class Cube { | |
public static void main(String[] args){ | |
Scanner input = new Scanner(System.in); | |
System.out.println("Enter the number: "); | |
int num = input.nextInt(); | |
for(int i=1; i<=num; i++){ | |
System.out.println("the cube of " + num + " is " + num*num*num); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment