Skip to content

Instantly share code, notes, and snippets.

@bmoore01
Last active April 28, 2016 11:26
Show Gist options
  • Save bmoore01/64c6fd0365b9e872184c512e1274e683 to your computer and use it in GitHub Desktop.
Save bmoore01/64c6fd0365b9e872184c512e1274e683 to your computer and use it in GitHub Desktop.
double a;
double b;
double c;
double d;
double sum;
double product;
for(a = 0.1;a <= 7.11;a += 0.1) {
for(b = 0.1;b <= 7.11;b += 0.1) {
for(c = 0.1;c <= 7.11;c += 0.1) {
for(c = 0.1;c <= 7.11;c += 0.1) {
sum = a + b + c + d;
product = a * b * c * d;
if(sum == 7.11 && product == 7.11)
//print sum, product, a, b, c and d
}
}
}
}
//print a b c d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment