C++ homework...confused!

I'm a little unsure of how to do this...Write a program that declares a 16-element vector of type double named x. The program should use a loop to initialize each element with the square root of the subscript. The program should then include a second loop that prints the contents of the vector.

Okay, I know how to declare it...apvector <double> x(16); but after that I get a little confused.
I know that I have to use x=sqrt(y) but I'm a little unsure with how to go about creating this program. Please help, I'd really appreciate it!
Last edited on
closed account (j3bk4iN6)
post what you have so far.
Topic archived. No new replies allowed.