Array Question

I am in a C++ programming class, but I am completely lost, please help!

An integer array xSquare has 50 elements. Write a program segment to initialize the elements with the square of the value of the array index. Output the array in two lines so that 25 elements per line are displayed.

Thanks for your help.
Last edited on
could you show us your code???
That's not how this forum works. You have to at least show other people your attempt before requesting any help from them.
closed account (48T7M4Gy)
http://www.cplusplus.com/doc/tutorial/arrays/

Have a look at this tutorial and in particular the sample programs which can be adapted to what you are after. for loops and lots of other stuff are in the tutorials on this website. We look forward to your program and any problems with that you might like people here to comment on.
Topic archived. No new replies allowed.