Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: pya
  • Order by date
  1. pya

    QBASIC Processing time

    Hi Mikrom, Thanx for all your help on this issue. I will now give programming a rest (and give you some peace also). Till I come across a suitable interesting problem to solve. I will try to solve it myself first, then try again, then probably fail and then finally in desperation I will...
  2. pya

    QBASIC Processing time

    Hi Mikrom, Yes, I set COUNT as As _Unsigned _Integer64 and it worked. I have now identified the 200,000,000th Prime. The program ran from21:30 till 08.20 approx 11 hours! However, the attached screen shows a strange negative number for Elapsed Time! Any idea what this is? pa99
  3. pya

    QBASIC Processing time

    I found the Error : I did not have a DIM statement for COUNT. the 20,000,000th Prime is 373587883 and it took 1187 s. pa99
  4. pya

    QBASIC Processing time

    Hi Mikrom, I tested your latest version with the counter but after about 17 minutes the program stops at 1.676E+07 and does not go up to the 20,000,000th Prime! I am sure this could be a limitation of either 1) my old DELL 15 laptop or 2) QBASIC. Would you be able to shed some light please? pa99
  5. pya

    QBASIC Processing time

    Thanx Mikrom. I will try to understand your code and test it in a few days time. Your help is much appreciated. pa99
  6. pya

    QBASIC Processing time

    Hi Mikrom, Thanx for your help. Your code has reduced processing time by over 50%. Very happy. (See below). I can now test large Primes. One more question: For very large Primes where K = 22,000,000, the program either a) stalls or b) takes an inordinate amount of time, after which I just...
  7. pya

    QBASIC Processing time

    My mistake. Output also tested on https://primes.utm.edu/nthprime/index.php#nth Thanx pa99
  8. pya

    QBASIC Processing time

    Hi Mikrom, This QBASIC program searches for the kth Prime Number and prints the Prime Number and k value. I have tested it on a site for checking Primes. Is there any way I can speed up the processing time? Your help appreciated. pa99
  9. pya

    Label Not Defined ERROR

    Thank you mikrom and Geates for your help. I am constantly learning through this forum. pya
  10. pya

    Label Not Defined ERROR

    Gents, I checked again and rectified the error. Although the conversion from Celsius to Fahrenheit and back is a simple calculation, one of my objectives is to keep learning through coding and invoking new functionality e g CASE SELECT, something which I had never heard of...
  11. pya

    Label Not Defined ERROR

    Hi Mikrom, After a long time I am trying to code with Subroutines. I get Error: Label Not Defined on Line 145 but not on 95. Why should this be? And what is the error trying to tell me? And how do I get rid of it? Thanx for your help...
  12. pya

    Branching with Strings Input

    Hi Mikrom, I am writing a simple Temperature conversion QBASIC Program for my grandson. Psuedo code looks like this INPUT T$ IF T$ C F K Depending on whether input is C F or K I will use a GOTO to carry out different calculations I am trying to avoid multiple IF statements and would like to...
  13. pya

    Name already in use ERROR

    Thanx Nice to know you are still in the game. Been a year since I last communicated with you. pa99
  14. pya

    Name already in use ERROR

    Writing a simple program which I will tidy up later but I need to resolve this Error. Please help. pa99https://files.engineering.com/getfile.aspx?folder=131b8266-c764-4ae2-bb74-d7d57165949b&file=QBASIC_Error.JPG
  15. pya

    Data Type Mismatch in QBASIC

    ...DIM P1, P2, N1, N2 AS _Unsigned _Integer64 120 INPUT “Number “; N 130 IF N <= 0 THEN GOTO 999 140 N1 = N 150 N2 = N 200 P1 = (6 * N1) -1 210 FOR N1 = 2 TO SQR(P1) 220 IF P1 MOD N1 = 0 THEN PRINT USING “################”; P1, : PRINT "is Composite": GOTO 300 230...
  16. pya

    Data Type Mismatch in QBASIC

    Hi Mikrom, Thanx for the tip. Code works for small numbers; I will now test for 10+ digit numbers. One more question: Is there a way of combining the 4 DIM statements into 1 line? eg DIM P1, P2, N1, N2 AS LONG Thanx pya
  17. pya

    Data Type Mismatch in QBASIC

    Hi Mikrom, Further to my post if I use PRINT instead of PRINT USING , the code works fine. But, PRINT USING should allow me to display the output number in detail instead of in scientific exp notation. Try the code with N = 3, 4, 5, 6, 59 and 288 to see how it works. Pervez
  18. pya

    Data Type Mismatch in QBASIC

    ...AS LONG 120 DIM N1 AS LONG 125 DIM N2 AS LONG 130 INPUT “Number “; N 140 IF N <= 0 THEN GOTO 999 150 N1 = N 160 N2 = N 200 P1 = (6 * N1) -1 210 FOR N1 = 2 TO SQR(P1) 220 IF P1 MOD N1 = 0 THEN PRINT USING “################”; P1; "is Composite": GOTO 300 230...
  19. pya

    Travelling Salesman Problem in QBasic

    Hi mikrom, One last question: How do I insert spaces between the brackets in the output? ( 2, .....7, 2 ) and ( 23, .... 19, 24 ) At my age I can get confused if the output is like (2, ....7, 2) and (23, .....19,24) I modified a few lines but got no change. Regards...
  20. pya

    Travelling Salesman Problem in QBasic

    Hi mikrom, I ran your code for 10 cities and it worked fine. But, I have a couple of questions and would be grateful if you could answer at your convenience. 1. I do not understand the first set of Distance Matrix - DATA 0,34,36 and the following 2 lines. 2. My 2nd question is where is the...

Part and Inventory Search

Back
Top