60 525
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #4266 in C++ for Nisa

Question #4266
Write a program that will accept a list of integer number. The odd numbers will be stored into a queue call ODDQUEUE and the even number will be stored in different queue call EVENQUEUE.

this is under subject data structure and algorithm so the code might be almost same to c++ but it is different in it structure
Expert's answer

#include <iostream>
#include <queue>

using namespace
std;


int main()
{
queue<int> EVENQUEUE,
ODDQUEUE;

int n;
cout << "Total number of items: ";
cin
>> n;

int q, i;
for (i=0; i<n; i++)
{
cout <<
"a[" << i << "]= ";
cin >> q;
if (q %
2)
{
EVENQUEUE.push(q);
}
else
{
ODDQUEUE.push(q);
};
};
return
0;
};

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions