Created
November 27, 2011 20:03
-
-
Save pasali/1398067 to your computer and use it in GitHub Desktop.
ayrıkBonus
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> | |
#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