Using the knowledge in computational language in JAVA it is possible to write a code that code segments will produce the same output as the code segment.
import java.io.*;
public class Main
{
public static void main(String[] args)
{
int n = 6;
for (int i = 1; i < n; i = i + 2) // Line 2
{
System.out.print(i + " ");
}
}
}
output:1 3 5
import java.io.*;
public class Main
{
public static void main(String[] args)
{
int n = 6;
for (int i = 1; i <= n; i = i + 2) // Line 2
{
System.out.print(i + " ");
}
}
}
See more about JAVA at brainly.com/question/29225072
#SPJ1