please help me in C++ Objective: Create a singly linked list of numbers based upon user input. Program logic: Ask for a number, add that number to the front of the list, print the list. Repeat until they enter -1 for the number. . Sample Input: 10, 15, 5, 2, 4, -1 Output: 4, 2, 5, 15, 10 Solution #include #include using namespace std; // It contains the value and the pointer to the next element in the list. struct element { int value; struct element *next; }; struct element *head = NULL; // The list is stored in the object of this class. class linkedlist { public: // To display list, we first see if head is NULL, // If head is NULL it means the list is empty. // Then we traverse along the list and display each item, until the next pointer is NULL. void display() { if(head == NULL){ cout << \"The list is empty\ \"; } else { struct element *temp; temp = head; while(temp != NULL){ cout << temp->value << \" \" ; temp = temp->next; } cout << \"\ \"; } } // To add an element to the list,create a newElement and store the value. // If head is NULL, add the newElement to the head. // To add an element at the starting of the list. // The next pointer of the newElement must point to the old head. // The new head must be pointed to the newElement. void add(int a){ struct element *newElement; newElement = (struct element *)malloc(sizeof(struct element)); newElement->value = a; newElement->next = NULL; if(head == NULL) { head = newElement; } else { newElement->next = head; head = newElement; } } }; int main() { // Create an object of the class linkedlist. linkedlist l = linkedlist(); int a; do { cout << \"Enter a number : \"; cin >> a; if(a!=-1) { // If the number is -1 do not add it to the list. l.add(a); // Add the number to the list. } l.display(); // Display the list. } while(a!=-1); // Keep asking for a number until -1 is pressed. return 0; }.