Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this problem, you have to take two char arrays of numbers (e.g. 1203009954 and 109876201453) from the user and store each char array (number)
In this problem, you have to take two char arrays of numbers (e.g. 1203009954 and 109876201453) from the user and store each char array (number) in a separate integer array. While storing a number in an array you have to keep in mind that each digit of that number should be stored in a separate index (apply validation check (e.g. no alphabets or special characters (+_-)(*&^%$#@!~`;:,./? Etc) allowed)). You have to add these two numbers and store answer in a third array digit by digit.
Example: 1 2 0 3 0 0 9 9 5 4 1 0 9 8 7 6 2 0 1 4 2 3 + 1 1 1 0 7 9 2 1 1 3 7 7
Test case1: Marks 10 Input Num 1: 120367 Input Num 2: 1203a7 Output: Second number is invalid Test case2: Marks 10 Input Num 1: 1233677001257 Input Num 2: 1002 Output: 1233677002259 Test case3: Marks 10 Input Num 1: 109876201453 Input Num 2: 1203009954 Output: 111079211407 Note: 1. String and built in functions not allowed. 2. Use cin.getline for inputs. 3. Max size of arrays will be 20..
use c++ and do not use classes
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started