Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions