fork download
  1. Identify the code used to generate a diagonal matrix, which has 0s and 1s.
  2.  
  3. Select one:
  4.  
  5. <?php
  6. for($c=1,$a=1;$a<=3;$a++) {
  7. for($b=1;$b<=3;$b++) {
  8. if($c!=$b)
  9. { echo $c; }
  10. else { echo "0"; }
  11. } $c--;
  12. echo "<br>";
  13. }
  14. ?>
  15.  
  16.  
  17. <?php
  18. for($a=1;$a<=3;$a++) {
  19. for($b=1;$b<=3;$b++) {
  20. if($c==$b)
  21. { echo $c; }
  22. else { echo "0"; } }
  23. $c; echo "<br>";
  24. }
  25. ?>
  26.  
  27.  
  28. <?php
  29. for($c=3,$a=1;
  30. $a<=3;$a++) {
  31. for($b=1;$b<=3;$b++) {
  32. if($c==$b)
  33. { echo $c; }
  34. else { echo "0"; }
  35. } $c;
  36. echo "<br>"; }
  37. ?>
  38.  
  39.  
  40. <?php
  41. for($c=1,$a=1;$a<=3;$a++) {
  42. for($b=1;$b<=3;$b++) {
  43. if($c==$b)
  44. { echo $c; }
  45. else { echo "0"; }
  46. } $c++; echo "<br>";
  47. }
  48. ?>
Success #stdin #stdout 0.02s 26036KB
stdin
Standard input is empty
stdout
Identify the code used to generate a diagonal matrix, which has 0s and 1s. 

Select one:

011<br>000<br>-1-1-1<br>

000<br>000<br>000<br>

003<br>003<br>003<br>

100<br>020<br>003<br>