Note: assembly language(8086 microprocessor) Write a program that takes a number N (2 digit decimal) as input. Then the user will enter that many numeric values ranging from 0 to 9 as input. Here the user may enter a negative number too. The program then finds a pair of values whose summation is closest to zero. Explanation: Here at first the user enters 10, which is a 2 digit decimal number. That means the user now has to enter 10 negative or positive digits ranging from 0 to 9. Then the program will calculate the sum of all possible pairs and find the pair which gives the minimum sum. Here from the given example, we see that the sum of -2 and -4 which is -6 is the least sum.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 9E: (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
Question

Note: assembly language(8086 microprocessor)

Write a program that takes a number N (2 digit decimal) as input. Then the user will enter that many numeric values ranging from 0 to 9 as input. Here the user may enter a negative number too. The program then finds a pair of values whose summation is closest to zero.

Explanation: Here at first the user enters 10, which is a 2 digit decimal number. That means the user now has to enter 10 negative or positive digits ranging from 0 to 9. Then the program will calculate the sum of all possible pairs and find the pair which gives the minimum sum. Here from the given example, we see that the sum of -2 and -4 which is -6 is the least sum.

Input:
10

-2, 3, 7, 4, -4, 7, -8, 0, 9, 9

Output:

Pair of values which has the smallest sum = -4, -2

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,