Skip to content

Latest commit

 

History

History
10 lines (5 loc) · 1.24 KB

readme.md

File metadata and controls

10 lines (5 loc) · 1.24 KB

Let, a number n support a number (n+x), where x is the number of bits in the binary representation of n, like if n = 10, whose binary representation is 1010, i.e x=4; then it supports (10+4)=14.

Now, in the questions, you are provided with an array of numbers. You have to print "SUPPORTED BY THE NUMBER (X)" if number is supported by any number 'X ' in the list and "NOT SUPPORTED" if there are no such number. If the array has duplicate entry, the function should print "Number 'X' has duplicate entry".

The program should handle all kinds of exceptions, like NULL array, String,duplicate entries.

Note : You have to take the input from the input.txt file, put in the same folder (Inputs taken from the keyboard will be condsidered as WRONG). The first line of the file contains the input array and second line onward it has the testing input on each line. You have to take those number and print necessary statements as per the question with proper exception handling. The output of the program MUST be stored in a file named 'output.txt', which will be in the same folder.

The answer to the question will be considered as COMPLETE only when you fulfil the above condition. Your code will be crosschecked with our various inputs and it must satisfy all those