Home /
Expert Answers /
Computer Science /
only-add-to-the-code-where-it-says-34-add-code-below-this-line-34-c-complete-the-function-that-takes-pa306
(Solved): only add to the code where it says "add code below this line"c++ Complete the function that takes a ...
only add to the code where it says "
add code below this line"
c++
Complete the function that takes a queue as an input. The function should do the following: - Delete any elements present in queue - Add the following elements in queue 1,3,5,7,9 When function is executed then queue should look like:
\#include using namespace std; void implementQueue (queue\& q) \{ /ladd code below this line /ladd code above this line \} void printQueue(std: :queue q) \{ while (!q.empty()) \{ std: : cout ?q. front ()? endl; q.pop(); 3 std: : cout ? std:: endl; \} int num = stoi (argv[1]); queueq; for (int i=0;i< num; i++){ int element = stoi (argv[i+2]); q.push (element); \} implementQueue (q); printQueue (q); return 0 ;