Write a program to get three numbers from user for integer variables a, b and c. If a isnot zero, find out whether it is the common divisor of b and c.
1
Expert's answer
2013-05-29T07:56:27-0400
#include <iostream> using namespace std;
int main() { int a, b, c; cout << "Input a: "; cin >> a; cout << "Input b: "; cin >> b; cout << "Input c: "; cin >> c; if (a != 0) { & if (b % a == 0 && c % a == 0) cout << "a is common divisor of b and c"; & else cout << "a isn't a common divisor of b and c"; & cout << endl; } }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment