C - Find the sum of the largest and smallest number in an Array. (Id-1742)
Author: SKILLRACK
N numbers are passed as input to the program. The program must find the sum of the largest and
smallest number in the Array,
Input Format:
The first line will contain the value of N.
Next N lines will contain the value of the N integers
Output Format:
The first line will contain the sum of the largest and smallest integers in the Array.
Boundary Conditions:
2 <= N <= 15
1 <= The values in the array <= 999999
Example Input/Output 1:
Input
5
100
200
555
Answers
Answered by
0
Answer:
This implies that
x2+2ax=4x−4a−13
or
x2+2ax−4x+4a+13=0
or
x2+(2a−4)x+(4a+13)=0
Since the equation has just one solution instead of the usual two distinct solutions, then the two solutions must be same i.e. discriminant = 0.
Hence we get that
(2a−4)2=4⋅1⋅(4a+13)
or
4a2−16a+16=16a+52
or
4a2−32a−36=0
or
a2−8a−9=0
or
(a−9)(a+1)=0
So the values of a are −1 and 9.
Similar questions