Skip to content

Instantly share code, notes, and snippets.

@shohan4556
Created October 23, 2014 09:05
Show Gist options
  • Save shohan4556/88a4fdc6a7a253a1d0ec to your computer and use it in GitHub Desktop.
Save shohan4556/88a4fdc6a7a253a1d0ec to your computer and use it in GitHub Desktop.
euler problem 09
#include <stdio.h> // solved by Md. shohanur Rahaman
int main()
{
int a,b,c,result;
int n,m;
for(n=2; ;n++){
for(m=1;m<n;m++){
a=(n*n)-(m*m);
b=2*n*m;
c=(n*n)+(m*m);
if(a+b+c==1000){
printf("%d %d %d \n",a,b,c);
printf("%d\n",a*b*c);
return ;
}
}// end child loop
;
} // end parent loop
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment