Using while loop

Can someone help me to make a program that will output all the common factors of two numbers that the user will input using while loop?

Another program that will display all the consonants from A to Z using while loop also.
Last edited on
It seems unlikely that my idea of “help” is the same as your idea.

Can you factor two numbers by hand?
What can you do to cause a computer to do it?

Can you write a loop?
Can you write an if statement that can tell you whether or not a character is a vowel/consonant?
https://en.cppreference.com/w/cpp/numeric/gcd
use the while loop to drive it down to pick off the other factors.

string s = "BCDFGHJKLMNPQRSTVWXYZ"; //Y?
int i = 0;
while(i < s.length())
cout << s[i++] << endl;

(Yes, my teachers all got grey hair because of me. The most amusing one was my 1 line traveling salesman greedy algorithm in excel... ). Im a work smarter kind of guy.
Last edited on
Topic archived. No new replies allowed.