package com.codegym.task.task01.task0140;
/*
Display the square of a number
*/
public class Solution {
public static int number = 2;
public static void main(String[] args) {
int square =(2*2);
{
System.out.println("square");
}
}
}
whats wrong in my code.
Resolved
Comments (6)
- Popular
- New
- Old
You must be signed in to leave a comment
Gaurav bhatt
28 February 2019, 15:19
/*
Display the square of a number
*/
public class Solution {
public static int number = 25;
public static void main(String[] args) {
System.out.println(number * number);
}
}
0
Tej M.Reddy
13 October 2018, 12:09
condition no. 3 : output must be a number .
line 14: just try to remove double quotes within the parenthesis.
suggestion: consider using the variable "number" as in your program it became unused!!
:-)
0
jacob sudarsan
9 October 2018, 15:38
in line 12 assign square= number*number
and remove quotation marks in println method
0
yanzy050
30 September 2018, 13:47
Who have a Facebook here? I want a team
0
Kumar Abhishek
18 September 2018, 16:43
Save the square in a different variable and then print the variable.
x = number*number;
S.O.P(x);
0
Khurram
18 September 2018, 10:12solution
the output statement should be displaying a number, not the text "square"
+2