DemonLeone6563 DemonLeone6563
  • 14-08-2020
  • Computers and Technology
contestada

cpp g Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards, then backwards. End each loop with a newline. Ex: If courseGrades

Respuesta :

wiitong0394703
wiitong0394703 wiitong0394703
  • 14-08-2020

Answer:

lol don't ask people to write code for you

assuming its an array, n is size.

normally:

for(int ele: courseGrades){

cout << ele <<" ";

}

cout << endl;

reverse:

reverse(courseGrades, courseGrades + n);

for(int ele: courseGrades){

cout << ele <<" ";

}

cout << endl;

Answer Link

Otras preguntas

How to study well for an exam ?
Translate the word phrase into a math expression.  nine more than five times a number                                           A. 9 > 5n B.
Which mathematical relationship best describes a graph of gravitational field strength versus distance? (one of the 3 pictures attached or none of the above?)
what is the perimeter of the inside of the track?use 3.14 for pie
what is the perimeter of the inside of the track?use 3.14 for pie
Why did the east German party cease to exist by the end of 1989?
Vivid writing includes ___ descriptions of things that can be seen, touched, heard, smelled, and tasted. A. sensuous B. tangent
What groups were threatened by john knox's ideas?
What is the maximum number of turning points the function f(x)=7x^5+6x^3-4x^2+1 , can have
Vivid writing includes ___ descriptions of things that can be seen, touched, heard, smelled, and tasted. A. sensuous B. tangent