Question: Write a C Program for the following: Create a doubly linked list. (till the input is -999, we can enter the nodes) Add 3 elements

Write a C Program for the following:

Create a doubly linked list. (till the input is -999, we can enter the nodes)

Add 3 elements at the beginning of the linked list. (If less than 3 elements are entered, the program should give Error message as output.)

Display the elements of the resulting doubly linked list in reverse order.

Sample Input/Output

Input

10 20 15 45 -999

-2 5 8

Output

45 15 20 10 -2 5 8

Input

84 19 32 45 25 39 -999

15

Output

Error!! Three elements must be inserted.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!