Answer:
#include<iostream>
using namespace std;
int lcm(int m, int n) {
int a;
a = (m > n) ? m: n;
while (true) {
if (a % m == 0 && a % n == 0)
return a;
++a;
}
}
int gcd(int m, int n) {
int r = 0, a, b;
a = (m > n) ? m : n;
b = (m < n) ? m : n;
r = b;
while (a % b != 0) {
r = a % b;
a = b;
b = r;
}
return r;
}
int main(int argc, char **argv) {
cout << "Enter the two numbers: ";
int m, n;
cin >> m >> n;
cout << "The LCM of two numbers is: " << lcm(m, n) << endl;
cout << "The GCD of two numbers is: " << gcd(m, n) << endl;
return 0;
}
Explanation:
Answer: statistician automotive engineer customer service specialist data modeler broadcast technician video systems technician
Explanation:
Answer:
if ( name1 > name2) {
first = name1;
} else {
first = name2;
}
Explanation:
First you need take a decision for that reason you need and if - else structure to decide if asign the variable name1 or the variable name2 to the result. Later you can use an > or < to compare two strings because it use the ASCII code to compare wich one is larger than another.
if ( name1 > name2) {
first = name1;
} else {
first = name2;
}
Answer:
You go to account settings, edit your profile and click preferences and then go to choose level and put which grade u are in the options r middle school, high school, and college
Explanation: