Write Java code to assign the value 10 to variable x and store its square value in another variable y.

4 views

2 Answers

x = 10;

y = x*x;

4 views

class Square

{

public static void main (String args [ ])

{

int x. y ; x = 10 : y = x * x ; 

4 views