#include #include #include #include using namespace std; int main() { int myints[] = {}; list l, l1 (myints, myints + sizeof(myints) / sizeof(int)); list::iterator it; int choice, item; while (1)...


#include
#include
#include
#include
using namespace std;
int main()
{
int myints[] = {};
list l, l1 (myints, myints + sizeof(myints) / sizeof(int));
list::iterator it;
int choice, item;
while (1)
{
cout<><>
cout<"***list><>
cout<><>
cout<"1.insert element="" at="" the=""><>
cout<"2.insert element="" at="" the=""><>
cout<"3.front element="" of=""><>
cout<"4.last element="" of="" the=""><>
cout<"5.size of="" the=""><>
cout<"6.display forward=""><>
cout<><>
cout<"enter your="" choice:="">
cin>>choice;
switch(choice)
{
case 1:
cout<"enter value="" to="" be="" inserted="" at="" the="" front:="">
cin>>item;
l.push_front(item);
break;
case 2:
cout<"enter value="" to="" be="" inserted="" at="" the="" end:="">
cin>>item;
l.push_back(item);
break;
case 3:
cout<"front element="" of="" the="" list:="">
cout<><>
break;
case 4:
cout<"last element="" of="" the="" list:="">
cout<><>
break;
case 5:
cout<"size of="" the="" list:=""><><>
break;


case 6:
cout<"elements of="" the="" list:="">
for (it = l.begin(); it != l.end(); it++)
cout<><">
cout<>
break;
case 7:
exit(1);
break;
default:
cout<"wrong><>
}
}
return 0;
}




TASK:




Run the above code and display the output of list as your Data of Birth, e.g., if your DOB is 17-02-1994, then output should be:

1 7 0 2 1 9 9 4

Also perform deletion from front and rare of list and attach output.

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here