4, 16, 36, 64, …(java program loop explain plss)
Answers
Answer:
Java source code is compiled into bytecode when we use the javac compiler. The bytecode gets saved on the disk with the file extension .class . When the program is to be run, the bytecode is converted, using the just-in-time (JIT) compiler. The result is machine code which is then fed to the memory and is executed.
Question:
4, 16, 36, 64…
Answer:
logic: [4 16 36 64 100 144 196 256 324 400]
Program:
class series
{
public static void main(String args[])
{
int x=0;
int add=x+8;
for(i=1; i<=400;i++)
{
add=add+i;
System.out.println(add);
}
}
}
Explanation:
Java source code is compiled into bytecode when we use the javac compiler. The bytecode gets saved on the disk with the file extension .class . When the program is to be run, the bytecode is converted, using the just-in-time (JIT) compiler. The result is machine code which is then fed to the memory and is executed.