Sorry, but I don't understand what you guys are talking about. :confused: (I'm almost a complete beginner in programming.) How exactly did you make it to 500 million?
Type: Posts; User: johan.g1
Sorry, but I don't understand what you guys are talking about. :confused: (I'm almost a complete beginner in programming.) How exactly did you make it to 500 million?
I thought my method above is the Sieve of Eratosthenes? Here's what I got.
Note: These are your highest values: for an unsigned long int: 18446744073709551615
and...
I need check large integers (up to 10 million) for primality. My usual way is as follows:
int prime[MAX] = {0}, i, j;
for(i=2;i<MAX;i++)
prime[i] = 1;
for(i=2;i<MAX;i++)
Ah, stupid mistake. It does work now, thanks!
I don't completely get the mechanism though. Why exactly the array is shifted when I initialized "int sum=0"?
I'm working on Project Euler 22. I think I got the logic and my code is a step away from the answer. But something creepy is going on.
Basically I have four functions: "read" to read the input of...
I see. Thanks!
I have this void function that modifies an array count[]. When I call this function inside printf, and print the resulting count[0] in the same printf, why isn't the array modified?
...
Thanks. I think I got it now. :D
I was having a lecture about pointers and I thought I understood already. Until I tried this simple code that doesn't work. It gives "Segmentation fault: 11".
#include<stdio.h>
int main()
{...