i need to get the output of
1 2 4 7 11 16 22
i know im on the right track however i cant figure out a way to get the outputs in the right form like 1+2+3 etc like its doing in the output i should get.
i know im a step or two off probably but any advice would be nice = )
my code reads:
public class assign6_4
{
public static void main (String [] args)
{
for(int x=0; x<1; x++)
{
for(int j= 1; j<=22; j=j+2)
{
System.out.print(j+ " ");
}
}
}
}