Please tell what will be the output when executed
int b=0;
for( int i=1; i<=5; i++)
{
b=(i*i*i)-1;
System.out.print(b+”,”);
Answers
Answered by
1
Answer:
CODE:
public class Main
{
public static void main(String[] args) {
int b=0;
for( int i=1; i<=5; i++)
{
b=(i*i*i)-1;
System.out.print(b+ ",");
}
}
}
OUTPUT
0,7,26,63,124,
Explanation:
I have compiled your Java Code and provided output above.
you made two mistakes in a given code:
1) miseed tab space near + and "
2)missed closing brace }
Similar questions