CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: rockx

Search: Search took 0.05 seconds.

  1. Thread: Prime Numbers

    by rockx
    Replies
    38
    Views
    10,511

    Re: Prime Numbers

    Please let me rephrase my question. COuld it be possible for j to contain only the calculated Prime Numbers, no other numbers apart from the calculated numbers?
  2. Thread: Prime Numbers

    by rockx
    Replies
    38
    Views
    10,511

    Re: Prime Numbers

    At the moment j consists of all integers, from 2 - sqrt(i). This is including all the calculated prime numbers as well as the composite numbers. So i m asking if j could be replaced with only the...
  3. Thread: Prime Numbers

    by rockx
    Replies
    38
    Views
    10,511

    Re: Prime Numbers

    I have got another question. the above code simply works fine. but is there any other way possible to further modify this


    This particular line does what its supposed to do:

    if (i % j == 0)
    ...
  4. Thread: Prime Numbers

    by rockx
    Replies
    38
    Views
    10,511

    Re: Prime Numbers

    I have tweeked the code a little bit more. And i know it could furthter be improved


    #include <iostream>
    #include <fstream>
    #include <string>
    #include <cstdlib>
    #include <cmath>
    using...
  5. Thread: Prime Numbers

    by rockx
    Replies
    38
    Views
    10,511

    Re: Prime Numbers

    so what could i use as my DataType instead of long int.
  6. Thread: Prime Numbers

    by rockx
    Replies
    38
    Views
    10,511

    Re: Prime Numbers

    I Used Ms Word to open it. but it failed
  7. Thread: Prime Numbers

    by rockx
    Replies
    38
    Views
    10,511

    Re: Prime Numbers

    Well i dont have set limit as yet. but as much s possible. say about 1-2 Trillion.
  8. Thread: Prime Numbers

    by rockx
    Replies
    38
    Views
    10,511

    Re: Prime Numbers

    so Eri523, what exactly would you suggest.

    i dont wanna see the output in the dos window, as i would like to keep a record of the output itself for future analysis and recording
  9. Thread: Prime Numbers

    by rockx
    Replies
    38
    Views
    10,511

    Re: Prime Numbers

    Now i have another problem. i have been entering pretty big numbers to calculate.....

    Somehow the other, the output file i got was over 512MB .doc file, and this failed the windows from opening...
  10. Thread: Prime Numbers

    by rockx
    Replies
    38
    Views
    10,511

    Re: Prime Numbers

    Hey thanks buddy, it was complete in less then about 2 seconds on my mchine. so could you please explain as to what was wrong in my code/syntax. and i really appreciate your kind help..... I hope and...
  11. Thread: Prime Numbers

    by rockx
    Replies
    38
    Views
    10,511

    Re: Prime Numbers

    Here is my Code..........Please Help!!!


    #include <iostream.h>
    #include <fstream.h>
    #include <string.h>
    #include <conio.h>
    #include <stdlib.h>

    void main()
  12. Thread: Prime Numbers

    by rockx
    Replies
    38
    Views
    10,511

    Prime Numbers

    I wouldn't be suprised if this question had been posted earlier. But i would like to streamline it a little bit so that i get to know what i m trying to find out......

    So if i write a Loop to...
Results 1 to 12 of 13





Click Here to Expand Forum to Full Width

Featured