Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7782241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:28:46+00:00 2026-06-01T19:28:46+00:00

I need some ideas for a homework assignment that I have. Consider the following

  • 0

I need some ideas for a homework assignment that I have.
Consider the following definition:

typedef struct listNode {
    int* dataPtr;
    struct listNode* next;
} ListNode;

typedef struct list {
    ListNode* head;
    ListNode* tail;
} List;

Each list node represents a single digit.
Each number is represented by a list, but in a reversed manner: the last digit of the number is the first list-node of the list, and the first digit of the number is the last list-node of the list.

I’ve written the function

void addNumbers(List n1, List n2, List *sum);

which returns a new list with the sum of the other two lists.

Now I have to write the function for multiplication:

void multNumbers(List n1, List n2 , List* prod);

And I’m kinda stuck with how to implement it. It’s not about the code, it’s about how to do it.
Needless to say, we’re not allowed to convert the numbers into an integer, multiply and go convert the result to a list.

Any help would be highly appreciated.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:28:47+00:00Added an answer on June 1, 2026 at 7:28 pm

    This will be a good exercise in code reuse. Since you already have created a function that adds two linked list numbers, can you utilize that function to perform (parts of) the multiplication? After all, multiplication can be performed by hand by repeatedly multiplying the first number by one of the digits from the second number, and then adding all of the results. Try something along these lines:

    • Create a linked list number that will contain the result, and set it to zero
    • Loop through the digits of the second number
      • For each digit, multiply the first number by that digit (you should write a separate function that does this; if you managed to write the addition function, this shouldn’t be too hard)
      • Append zeroes to the end of the result so that the digits get shifted far enough to the left
      • Add the number to the result, using addNumbers()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some ideas on how I can best solve this problem. I have
i need some ideas for accessing door lock device that mean i want control
I have a problem and i need some ideas to solve it: I have
I need some ideas for a design problem, i have the need for a
I need some ideas how to create a activation algorithm. For example i have
today i have direct a problem :P i just need some ideas... how do
I have three buttons and need to save some data. I have a idea,
Need some help about with Memcache. I have created a class and want to
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help to solve this. I have a gridview and inside the gridview

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.