Computer Science, asked by lovelysonu, 6 hours ago

Write a program to read two values a and b from user and then print values as a^3,(a+1)^3, ..., b^3. (e.g., if user enters 3 and 7, then the program should print values as per this : 3^3 4^3 5^3 6^9 7^3'.)

plz answer it.... it's urgent​

Answers

Answered by keerthanakrishna59
2

import java.util.Scanner; public class Exercise5 { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Input first number: "); int num1 = in.nextInt(); System.out.print("Input second number: "); int num2 = in.nextInt(); System.out.println(num1 + " x " + num2 + " = " + num1 * num2); }

hope it helps

mark as brainest and follow

Similar questions