Completion of randomly positive and negative numbers



  • Hello! How can the matrix be filled in randomly so that the numbers are both positive and negative? I'm positive about that.

    randomize;
       for i:=1 to n do
          for j:=1 to n do
             matr[i,j]:=random(10);
             write(matr[i,j]:5)
             writeln;
    

    What needs to change?



  • The negatives can be obtained from positive non-chemical arithmetic operations. Like, I need numbers from 10 to 10. We get an accident number between 0 and 20 and count 10. That's it.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2