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, 22.06.2019 04:30
Ryan is working on the layout of her web page. she needs to figure out where her header, navigation bar, text, and images should go. what technique can her?
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When using a public computer or network, you should always
Answers: 2
question
Computers and Technology, 23.06.2019 01:50
Write a program that uses a random number generator to generate a two digit positive integer and allows the user to perform one or more of the following operations: a. double the number. b. reverse the digits of the number. c. raise the number to the power of 2, 3, or 4. d. sum the digits of the number. e. if the number is a two-digit number, then raise the first digit to the power of the second digit. f. if the number is a three-digit number and the last digit is less than or equal to 4, then raise the first two digits to the power of the last digit. after performing an operation if the number is less than 10, add 10 to the number. also, after each operation determine if the number is prime. each successive operation should be performed on the number generated by the last operation. your program should not contain any global variables and each of these operations must be implemented by a separate function. also, your program should be menu driven. 7. (fraction calculator) write a program that
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Arecipients list has been loaded into a document. which commands should be clicked in order to filter the list so that letters will not be printed for recipients who live in a certain state? mailings tab, start mail merge, select recipients, type new list, then insert only contacts from the desired states mailings tab, rules, select recipients, use existing list, then choose a recipients list that includes only contacts in certain states mailings tab, select recipients, use existing list, rules, fill in, then type in certain states mailings tab, rules, skip record select “state” under field name, then type in the state name under “equal to”
Answers: 2
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, 03.02.2021 01:00
question
Advanced Placement (AP), 03.02.2021 01:00
question
Engineering, 03.02.2021 01:00
question
Mathematics, 03.02.2021 01:00
question
Mathematics, 03.02.2021 01:00
question
Mathematics, 03.02.2021 01:00
question
Health, 03.02.2021 01:00
question
Mathematics, 03.02.2021 01:00
Questions on the website: 13722367