Computers and Technology

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)​

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:10, Olaf2018
Drag each label to the correct location on the imagelist the do’s and don’ts of safeguarding your password. keep yourself loggedin when you leave your computer. don’t write your password down and leave it whereothers can find it. share your password with your friends. each time you visit a website, retain the cookies on your computer. use a long password with mixed characters.
Answers: 1
image
Computers and Technology, 23.06.2019 04:40, Koriunaa
The narrative structure of the popular movies can be broken down into
Answers: 3
image
Computers and Technology, 23.06.2019 12:00, kp2078
What type of slide show is a dynamic and eye-catching way to familiarize potential customers with what your company has to offer? a. ole b. photo album c. brochure d. office clipboard
Answers: 2
image
Computers and Technology, 25.06.2019 02:00, lovemykay2355
Software and services are used to conceive, plan, and execute projects in any field. these tools are excellent methods of increasing the probability of successful projects. open source linux project management mind-mapping
Answers: 2
Do you know the correct answer?
Write a program in C to fulfil the following requirements. Write a function that will accept an int...

Questions in other subjects: