WAP to enetr a number of integer type and print its square and cube on separate line....
Plss help....
Answers
Answered by
2
Explanation:
import java.util.*;
class prog
{
public static void main(String args[])
{
Scanner sc =new Scanner(System.in);
int a;
System.out.println("Enter number:") ;
a = sc.nextInt();
System.out.println((a*a)+" is the square of the input integer") ;
System.out.println((a*a*a)+" is the cube of the input integer") ;
}
}
Hope this is helpful and mark it as the brainliest answer
Answered by
2
class pro
{
public static void main(double num)
{
double s, q;
s=num*num;
q=num*num*num;
System.out.println(“The square is” + s);
System.out.println(“The cube is” + q);
}
}
Hope this helps you
Actually I just need one brainliest to reach virtuoso so plz mark me as the brainliest
Happy Learning:D :D :D :D :D
{
public static void main(double num)
{
double s, q;
s=num*num;
q=num*num*num;
System.out.println(“The square is” + s);
System.out.println(“The cube is” + q);
}
}
Hope this helps you
Actually I just need one brainliest to reach virtuoso so plz mark me as the brainliest
Happy Learning:D :D :D :D :D
Similar questions