+ 1
Java program to calculate square of a number......need help with that please
Write a simple program to calculate the square of a number when it is imputed must accept multiples of 2
9 Answers
+ 2
Have you tried it yourself ? Could you please post your attempt ?
+ 1
kk
+ 1
Yup Paul Dey I suppose that code won't work... ok first of all, ask yourself, what is the meaning of int x {2,6,8,10,12}...
+ 1
Ok that is not how arrays are defined in Java....check these links to clear things out :
https://www.sololearn.com/learn/Java/2139/
https://www.sololearn.com/learn/Java/2148/
https://www.sololearn.com/learn/Java/2208/
https://www.sololearn.com/learn/Java/2147/
+ 1
You're welcome đđ
0
public class Program
{
public static void main(String[] args) {
int x {2, 6, 8, 10, 12}
for{i=0, i<no. length, i++}
}
}
0
getting confused
0
thus an array
0
thanks a lot