You are provided with 3 numbers : input1, input2 and input3. Each of these are four digit numbers within the range >=1000 and <=9999 j.e. 1000 <= input1 <= 9999 1000 <= input2 <= 9999 1000 <= input3 <= 9999 You are expected to find the Key using the below formula - Key = [largest digit in the thousands place of all three numbers] [largest digit in the hundreds place of all three numbers] [largest digit in the tens place of all three numbers] [largest digit in the units place of all three numbers] For e..g. if input1 = 3521. input2=2452. input3=1352, then Key =(1+2+1)-(5+5+5)= -11
Java OR C++ code please
Answers
Answered by
1
It is quite easy. Define three arrays
a[ ], b[ ] and c[ ].
All these arrays are single dimension.
For retrieval/ comparison of the digits at any place, you may simply write as
cout<< std::max ( a[0], b[0], c[0] )
This will print the the largest element of three arrays at the Units Place.
Similarly, you can do for others.
Answered by
0
Answer:
v v xhxgzh jxgznjccjcn ncjhdhdy
Similar questions
Computer Science,
3 months ago
Business Studies,
3 months ago
Science,
3 months ago
English,
7 months ago
Math,
11 months ago
Math,
11 months ago
Math,
11 months ago