You are not logged in. Please login at www.codechef.com to post your questions!

×

Adding 2 numbers using doubly linked list in C++

The user is supposed to enter 2 numbers.And then you need to create separate lists for the 2 numbers.Now you need to split the 1st number into the nodes of the list.(for example the user entered a number of 20 digits.then each node should contain atleast 4 digits of the number).Now you need to add these two numbers according the nodes and the carry should be added to the next nodes.It means that the first node of the first list will be added to the first node of the second list and if there is a carry then it will be added to the second nodes.The following result should be stored in a new list following the same pattern of storing 4 digits in one node.

asked 22 Nov '18, 11:21

aayush_1207's gravatar image

0★aayush_1207
1
accept rate: 0%

Yeah so what's the issue then.. do it..

(22 Nov '18, 14:21) l_returns4★

Use modulo and division operator... And three linked lists...

(22 Nov '18, 14:39) l_returns4★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,901
×29
×16

question asked: 22 Nov '18, 11:21

question was seen: 66 times

last updated: 22 Nov '18, 14:39