Christos
  • Christos
1) Write a program and do the following each in a separate statement: a) Declare an array called “Num” with 15 integers. b) Initialize all the items of the array to 0. c) Change all the items of the array with an ODD position to -1. d) Ask the user to enter values only at the items with an EVEN position. e) Display the position along with the item, for all items in the array, each in a separate line.
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
So: a) int Num[15]; b) for(int k=0; k<15; k++) { Num[k]=0; } c) for(int k=0; k<8; k++) { Num[2k+1]=-1; } d) int input; cout<<"Enter calues only at an even position: "<>input This should be enough help, I will leave the last one to you.
Christos
  • Christos
But how do I actually print the (a) qith C++ ? @jlvm
anonymous
  • anonymous
I do not understand your question. First, which part of the question are you referring to? Second, b clear about what you want to know? Did you mean how to print the ith element in the array?

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

Christos
  • Christos
How to print the Num[15] - meaning all the numbers of the said array ?
anonymous
  • anonymous
Look at part (b).
anonymous
  • anonymous
Do you know what that is called?
Christos
  • Christos
It is my first time working with arrays so unfortunately I can't tell :/
anonymous
  • anonymous
Nothing to do with arrays. It's a loop.

Looking for something else?

Not the answer you are looking for? Search for more explanations.