Thread: Newbie here plz help!

  1. #1

    Unhappy Newbie here plz help!

    Hello guys and thanks for your time...
    i'm having a difficulty in finding the prime numbers from 2 to n, where n a number i enter...could you help me please?(well i'm not so good at maths i suppose!)
    thank you

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    The ever friendly google should help ya:

    First page come up with a prog to do what you asked.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Go here

    If that doesn't help, post your code so we can see which part you're having problems with.

  4. #4
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    here's the bfi method:
    PHP Code:
    int main() {
    int n=340/* some number */
    int count;
    for (
    count=2count ncount++)
      if (
    printf("%d is prime\n",count);

    bool isprime(int y) {
    /*you figure this part out*/
      check all integers from 2 to the square root of y plus 1
      if y mod n is 0, then return true
     else return false

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie c programmer need assistance plz...
    By Nexus-ZERO in forum C Programming
    Replies: 17
    Last Post: 12-27-2007, 04:05 PM
  2. Newbie needs help plz
    By boffinson in forum C++ Programming
    Replies: 22
    Last Post: 07-29-2006, 03:25 AM
  3. im newbie to opengl, help plz
    By NecroFromHell in forum C++ Programming
    Replies: 4
    Last Post: 05-14-2006, 08:24 PM
  4. newbie reading a plz help
    By iori in forum C Programming
    Replies: 3
    Last Post: 04-09-2003, 03:58 PM
  5. HI .. newbie to the board... need some help plz
    By Arwen27 in forum C Programming
    Replies: 3
    Last Post: 04-28-2002, 07:27 AM