Created
October 23, 2014 09:05
-
-
Save shohan4556/88a4fdc6a7a253a1d0ec to your computer and use it in GitHub Desktop.
euler problem 09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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