Skip to main content

Timeline for Finding prime numbers in a range

Current License: CC BY-SA 3.0

10 events
when toggle format what by license comment
May 23, 2017 at 12:40 history edited CommunityBot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Jul 28, 2014 at 8:55 comment added Edward I mean that you could use getline to fetch an entire line, and then use atoi to pull out an integer. However if you feed it a string like [1,2,+,3,-,4,5] it will simply return '0'.
Jul 28, 2014 at 5:32 comment added Ashhar Hasan Also how exactly does atoi() function. Suppose I have a string like [1,2,+,3,-,4,5]. How does atoi() process the string? (PS: I actually need this for another one of my programs.)
Jul 28, 2014 at 5:30 comment added Ashhar Hasan Thanks a lot. I never really pondered enough to notice that all primes except two are odd. About scanf, do you mean to say that I should use something like gets() to read in the input as a string and then process it? And do for loops and while loops have any major difference in functionality that I should know of? WHITESPACES.
Jul 28, 2014 at 5:30 vote accept Ashhar Hasan
Jul 26, 2014 at 17:02 comment added Edward @rolfl: hold on, I have to reload the paper roll in my TTY...
Jul 26, 2014 at 16:57 comment added rolfl for (int lines=40; lines; --lines) putchar('\n'); really? Otherwise +1
Jul 26, 2014 at 14:16 history edited Edward CC BY-SA 3.0
added results.
Jul 26, 2014 at 14:08 history edited Edward CC BY-SA 3.0
added further optimization hint
Jul 26, 2014 at 14:00 history answered Edward CC BY-SA 3.0