now signed and xx th fibonacci´number
This commit is contained in:
parent
9eba8b5e33
commit
48dac3fb2d
10
prim.c
10
prim.c
@ -1,7 +1,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#define typ unsigned long long
|
#define typ long long int
|
||||||
|
|
||||||
|
|
||||||
bool is_it_a_prim(typ* x){
|
bool is_it_a_prim(typ* x){
|
||||||
@ -16,14 +16,16 @@ return true;
|
|||||||
|
|
||||||
|
|
||||||
int main(void){
|
int main(void){
|
||||||
typ int fn = 0, fn_1 = 1, fn_2 = 0;
|
typ fn = 0, fn_1 = 1, fn_2 = 0;
|
||||||
while(fn < ULLONG_MAX)
|
int i = 2;
|
||||||
|
while(fn < LLONG_MAX)
|
||||||
{
|
{
|
||||||
fn = fn_1 + fn_2;
|
fn = fn_1 + fn_2;
|
||||||
if(is_it_a_prim(&fn))
|
if(is_it_a_prim(&fn))
|
||||||
printf("%llu\n",fn);
|
printf("%d\t%llu\n",i ,fn);
|
||||||
fn_2 = fn_1;
|
fn_2 = fn_1;
|
||||||
fn_1 = fn;
|
fn_1 = fn;
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user