adding a second variable into the first...
| theooze (2) | |||
| hello...i need to output "1 4 9 16 25 36 49 64 81 100 121 144" i can see the pattern as x + 2 (3 5 7 9...) however i am having trouble nesting a loop to get that variable to function where do i need to define the 'h' in my code and how should i format that? thanks in advance this has taken me hours of trial and error. cheers~j --------------------------------------------------------------------------------
| |||
| theooze (2) | |||
| actually i think my question is better as 'how do i count up by 1 number squaring it.....1*1 then 2*2....' if that helps...but i am still stuck i get 1 4 25 end | |||
| hamsterman (56) | |||
for(int i=1; i<=12; i++)cout<<i*i<<" "; | |||
This topic is archived - New replies not allowed.
