3. Make a program that determines whether two input numbers are coprime or not. Two numbers are coprime if the only positive number that perfectly divides them is 1. In other words, two numbers can be coprime only if their gcd is 1. 4. GCD * LCM = a*b Where * is the multiplication symbol. Suppose that the user only enters 3 out of 4 values and -1 for the 4th value. You have to print the 4th value on the basis of the entered values. For example if the user enters 3 and 6 for the values a and b and 3 and -1 for the gcd and lcm then the value of lcm would be 6. 5. Write a C++ program that can interleave bits of two entered 16 bit variable and stores the result in a 32 bit variable. For example, if user provides x and y, then the resulting number has bits of x at even position and bits of y at odd position. You will have to explore bitwise operators for the purpose http://www.cprogramming.com/tutorial/bitwise_operators.html
1
Expert's answer
2012-07-20T08:49:32-0400
Unfortunately, your question requires a lot of work and cannot be done for free. Submit it with all requirements as an assignment to our control panel and we'll assist you.
Comments
Leave a comment