Skip to content

Instantly share code, notes, and snippets.

@cagataycali
Created October 3, 2015 14:01
Show Gist options
  • Save cagataycali/eb12cb69ef4456f30c0a to your computer and use it in GitHub Desktop.
Save cagataycali/eb12cb69ef4456f30c0a to your computer and use it in GitHub Desktop.
C dilinde , Hipotenusu 500'e kadar olan pisagor üçlülerini ekrana yazan program
/* Hipotenusu 500'e kadar olan pisagor uclulerini ekrana yazar. */
#include<stdio.h>
int main( void )
{
int a; /* birinci dik kenar */
int b; /* ikinci dik kenar */
int hipotenus;
for(a = 1; a < 500; a++)
for(b = a; b < 500; b++)
for(hipotenus = b+1; hipotenus <= 500; hipotenus++)
if( (a*a + b*b) == hipotenus*hipotenus )
printf("%5d%5d%5d\n", a, b, hipotenus);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment