Skip to content

Instantly share code, notes, and snippets.

@pasali
Created November 27, 2011 20:03
Show Gist options
  • Save pasali/1398067 to your computer and use it in GitHub Desktop.
Save pasali/1398067 to your computer and use it in GitHub Desktop.
ayrıkBonus
#include<stdio.h>
#include<time.h>
float hesapla(int x)
{
int kalan;
kalan = x % 4;
switch (kalan){
case 1:return 2;
case 2:return -3;
case 3:return -0.5;
case 0:return 0.3;
}
}
int main(void)
{
srand(time(NULL));
double sure;
clock_t basla;
clock_t bitis;
float sayi,he;
basla = clock();
sayi = pow(2,32);
he = hesapla(sayi);
bitis = clock();
sure = (double)(bitis - basla) / CLOCKS_PER_SEC;
printf("sonuc = %f\nsure = %1f ",he,sure);
getchar();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment