Question
C++ PROGRAMMING: PLEASE MAKE SURE THE PROGRAM COMPILES AND RUNS FOR 5 STARS :-) For this assignment youll be creating several programs (or, if youre
C++ PROGRAMMING: PLEASE MAKE SURE THE PROGRAM COMPILES AND RUNS FOR 5 STARS :-)
For this assignment youll be creating several programs (or, if youre so inclined, one program with multiple functionality) to deal with the purpose of finding primes, co-primes, gcds, and lcms. Your program(s) will need to do the following:
1.) Given a single number, use the Sieve of Eratosthenes to print out all prime numbers between one and the given number, if the given number itself is also prime.
2.) Given two numbers, use Euclids Algorithm to compute both the Greatest Common Divisor and the Least Common Multiple for the two numbers.
3.) Given three numbers, determine if the given numbers are relatively prime, meaning that the three of them together only share a GCD of 1. If theyre relatively prime, have your program say so, and if theyre not, print out what their common GCD is.
Feed your program(s) the following numbers, and give screenshots of the results:
1.) 77
2.) 458
3.) 1447
4.) 294 & 966
5.) 367 & 409
6.) 728 & 2408
7.) 14, 49, & 342
8.) 119, 629, & 1411
9.) 42, 1337, & 1030301
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started