Answered step by step
Verified Expert Solution
Link Copied!

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

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

What is the cerebrum?

Answered: 1 week ago