Menu

Errooor

Anonymous
2017-09-14
2017-09-15
  • Anonymous

    Anonymous - 2017-09-14

    Hello, I was using pc-basic, and I started to write a simple program, just for exercise, the program asked some numbers and then asked the type of account you wanted, ok the code was working perfectly, but the bills were wrong , for example -1 -1 -1 -1 was giving -2, I was using integer variables, all correct, so why were the beads?

     
  • Rob Hagemans

    Rob Hagemans - 2017-09-14

    Hi, I'm sorry, I don't understand what you are trying to do. If I do PRINT -1-1-1-1 I get -4, as expected. Can you attach the program you're using, and describe exactly what inputs you use, what you expect to happen and what happened instead?

     
  • Anonymous

    Anonymous - 2017-09-14

    I basically created a calculator, but when I was going to make the sums, subtractions, etc. the value never worked correctly, the program asked for 4 numbers, and then I asked the type of mathematical operation, but the result always goes incorrect
    which I basically wrote in the program:
    100 print "hello, please say me the first number"
    110 input a%
    120 print "the second"
    130 input b%
    140 print "third"
    150 input c%
    160 print "fourth"
    170 input d%
    180 print "enter the desired math operation"
    input e$
    190 if e$="sum" then print a%+b%+c%+d%
    program worked perfectly, taking the math part of it to go wrong

     
    • Rob Hagemans

      Rob Hagemans - 2017-09-15

      The above works fine for me though - see screenshot attached.

       
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.