#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Need help with a loop

KatvijaMember Posts: 1

Hello, i need to let user enter a range for example 1-15

The output should be :

1square + 1square = 2 print to screen and increment right square
1square + 2square = 5 print to screen and increment right square
1square + 3square = 10 print to screen and increment right square
1square + 4square = 17 17 is > 10, so increment left square and right square = 1
2square + 1square = 5 print to screen and increment right square
2square + 2square = 8 print to screen and increment right square
2square + 3square = 13 13 is > 10, so increment left square and right square = 1
3square + 1square = 10 print to screen and increment right square
3square + 2square = 13 13 is > 10, so increment left square and right square = 1
4square + 1square = 17 The program would stop here

Could anyone help me with these loops?

``````for(i = 1; i < range; i++)