
Add, Subtract, Multiply big numbers in C project
- or -
Post a project like this2666
€40(approx. $47)
- Posted:
- Proposals: 5
- Remote
- #2029335
- Awarded
Description
Experience Level: Intermediate
This project in general is about add, subtract and multiply big numbers. At the end of the program we need to compute 100!.
Build a program in C with which very large integer numbers will be entered as strings. Each character will then be converted to the corresponding digit. The calculations of the operations will be done with the methodology of the vertical acts as you had learned in the primary school. The result will be saved and printed on the computer screen as a string.
Adding example:
237462374678324834
+723674629462912321
961137004141237155
Multiply example:
823473487473
*2308230092370937
1900766284054820422538772201
The project is divided in these versions:
Version1: Add Big Numbers
Construct the int addHugeNumbers (char * a1, char * a2, char * res) which accepts three character tables. The first two tables contain the digits of the numbers to be added and in the third table the sum of the numbers will be stored as a sequence of digits. The function needs to check if the contents of the tables given contain only digits. Then make the add of these numbers, and save the result in the char * res and return the value 1, otherwise it returns 0. Build the program that will read a string from the keyboard, for example 65238340450345034503453453+233474583479475834758934578934578474623632, with the maximum length of 1000 characters, and it will use the function addHugeNumbers to add the two numbers . The result will be printed on the terminal screen.
Version2: Subtract Big Numbers
As in version1 construct the int subHugeNumbers function (char * a1, char * a2, char * res) which accepts three character tables. The first two tables contain the digits of the numbers to be subtracted and in the third table the result will be saved as a sequence of digits with also a numeric sign (if necessary). The function needs again to check if the contents of the tables given contain only digits. Then it substracts, saves the result in the res array and returns the value 1, otherwise it returns the value 0. Construct the program that will read a string from the keypad, for example, 625238340450345034503453453233474583479475-834758934578934578474623632 with a maximum length of 1000 characters and use the subHugeNumbers function to perform the subtraction. The result will then be printed on the terminal screen.
Version3: Multiply Big Numbers
As in the above two versions, we construct the int MulHugeNumbers function (char * a1, char * a2, char * res) which accepts three character tables. The first two tables contain the digits of the numbers involved in the act of multiplication, and the third table will store the result as a sequence of digits. The function needs to check if the contents of the tables given contain only digits. Then it multiplies, saves the result in the res array and returns the value 1, otherwise it returns 0. Build the program that will read two numbers from the keyboard and print their output on the terminal screen.
Version4: Compute 100!
Using the function from the previous versions, construct a program that will compute and print the 100!
Each version to be in separate folder with each own source code.
Deadline is 9th of June 20:00 CET.
Thank you.
Build a program in C with which very large integer numbers will be entered as strings. Each character will then be converted to the corresponding digit. The calculations of the operations will be done with the methodology of the vertical acts as you had learned in the primary school. The result will be saved and printed on the computer screen as a string.
Adding example:
237462374678324834
+723674629462912321
961137004141237155
Multiply example:
823473487473
*2308230092370937
1900766284054820422538772201
The project is divided in these versions:
Version1: Add Big Numbers
Construct the int addHugeNumbers (char * a1, char * a2, char * res) which accepts three character tables. The first two tables contain the digits of the numbers to be added and in the third table the sum of the numbers will be stored as a sequence of digits. The function needs to check if the contents of the tables given contain only digits. Then make the add of these numbers, and save the result in the char * res and return the value 1, otherwise it returns 0. Build the program that will read a string from the keyboard, for example 65238340450345034503453453+233474583479475834758934578934578474623632, with the maximum length of 1000 characters, and it will use the function addHugeNumbers to add the two numbers . The result will be printed on the terminal screen.
Version2: Subtract Big Numbers
As in version1 construct the int subHugeNumbers function (char * a1, char * a2, char * res) which accepts three character tables. The first two tables contain the digits of the numbers to be subtracted and in the third table the result will be saved as a sequence of digits with also a numeric sign (if necessary). The function needs again to check if the contents of the tables given contain only digits. Then it substracts, saves the result in the res array and returns the value 1, otherwise it returns the value 0. Construct the program that will read a string from the keypad, for example, 625238340450345034503453453233474583479475-834758934578934578474623632 with a maximum length of 1000 characters and use the subHugeNumbers function to perform the subtraction. The result will then be printed on the terminal screen.
Version3: Multiply Big Numbers
As in the above two versions, we construct the int MulHugeNumbers function (char * a1, char * a2, char * res) which accepts three character tables. The first two tables contain the digits of the numbers involved in the act of multiplication, and the third table will store the result as a sequence of digits. The function needs to check if the contents of the tables given contain only digits. Then it multiplies, saves the result in the res array and returns the value 1, otherwise it returns 0. Build the program that will read two numbers from the keyboard and print their output on the terminal screen.
Version4: Compute 100!
Using the function from the previous versions, construct a program that will compute and print the 100!
Each version to be in separate folder with each own source code.
Deadline is 9th of June 20:00 CET.
Thank you.

Tony F.
100% (5)Projects Completed
4
Freelancers worked with
2
Projects awarded
67%
Last project
16 Jun 2018
Greece
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies