+ 1

Read a number and print your square in java language

help me...this is homework.

9th Mar 2018, 12:47 PM
Aniceto Do RosĆ”rio PrimeirošŸ‡²šŸ‡æšŸ‡²šŸ‡æ
Aniceto Do RosĆ”rio  PrimeirošŸ‡²šŸ‡æšŸ‡²šŸ‡æ - avatar
2 Answers
+ 12
System.out.print(num*num);
9th Mar 2018, 1:12 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 2
I'll assume you mean the square of the input: import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int i = scan.nextInt(); System.out.println(Math.pow(i, 2)); } }
9th Mar 2018, 1:01 PM
apex137
apex137 - avatar