Composite magic number is a positive integer

Question 1A composite Magic number is a positive integer which is composite as well as a magic number. Composite number: A composite number is a number which has more than two factors. For example: 10 Factors are: 1,2,5,10 Magic number: A Magic number is a number in which the eventual sum of the digitd is equal to 1. For example: 28 = 2+8=10= 1+0=1 Accept two positive integers m and n, where m is less than n as user input. Display the number of composite magic integers that are in the range between m and n (both inclusive) and output them along with frequency, in the format specified below: Example:Input: m=10n=100OUTPUT:The composite magic numbers are 10,28,46,55,64,82,91,100Frequency of composite magic numbers: 8Input: m=120n=90OUTPUT:Invalid input

Leave a Reply

Your email address will not be published. Required fields are marked *