subject

Write a program in C to fulfil the following requirements. Write a function that will accept an integer as an parameter. Check whether it forms a friendly pair or not. If it forms a friendly pair with a different number then the function will return that number. If the number is not friendly or friend to itself or the given number was negative the function will return 0. (two numbers are friendly if the summation of true factors of the first number is the second one and the summation of true factors of the second number is the first number). The number 6 is friendly to itself hence do not form a friendly pair. The factors of a number that are not equal to the number itself are called “True factors”.
Write a function that will return the LCM of two positive integers sent as parameter. And will return 0 if parameters are invalid.
Design a structure in the program that will have four integers and a real number as its member.
Write a function that will display the information stored in a structure variable of the above type sent as a parameter. All five members should be displayed in a single line, and separated by TAB.
The main function will accept an integer larger than 5000. The program should be able to find all the unique friendly number pairs. (ie. if A, B are found to be friendly, B and A should not be declared again as friendly again).
The first output for a valid input should be the total number of friendly pairs found in the given range.
Then it should display the following information for each of the friendly pairs separated by TAB and in one line for one pair in the format - Smaller one of the friendly pair, Larger one of the friendly pair, HCF or GCD of the friendly pair and LCM of the friendly pair and the average of the friendly pair.
After producing the above output, program should display the integer value equivalent to the bitstring of the average of each of the friendly pair. (Hint. For any of the friendly pair you will get a value that is greater than 1 crore)
The program should waste as less as possible memory space. (Variable declared but not used are waste, if use three variable could solve the problem, but fourth variable were used then fourth variable is wasting memory. Memory kept in reserve assuming that may be needed sometime but not used while program is running, are waste. Memory reserved and used during execution but no longer need it in remaining part of the program are waste)​

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:30
What is the original authority for copyright laws
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
Report all segments of identity by descent longer than 20 polymorphisms between pairs of individuals in the following cohort of 15 individuals across 49 polymorphisms: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 numeric input 2 points possible (graded) you have 2 attempts to complete the assignment below. for example if the sequence is "bcd", which occurs in "abcdef" , the starting point would be 2 (b), and the finishing point would be 4(d). individuals 7,10 between positions
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
How can the temperature of a room be raised by 5degreesf?
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Which sentences describe the things you need to ensure while creating a sketch and a drawing? while an artistic or creative drawing is a creative expression, a technical drawing is an informative expression. you need to create accurate and neat drawings to convey accurate information. a technical drawing clearly conveys its meaning or information, and does not leave room for interpretation maintain a good speed while creating drawings
Answers: 1
You know the right answer?
Write a program in C to fulfil the following requirements. Write a function that will accept an int...
Questions
question
Mathematics, 22.11.2021 16:50
question
Mathematics, 22.11.2021 16:50
Questions on the website: 13722360