Guest User

Untitled

a guest
Apr 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. /*
  2. @author: Rahul Chatterjee
  3. @filename: matrix.c
  4. Diagonal matrix : Every off-diagonal entry is 0
  5.  
  6. 3000
  7. 0000
  8. 0010
  9. 0009
  10.  
  11. Identity Matrix: Every diagonal entry is 1, all other entries 0
  12.  
  13. 1000
  14. 0100
  15. 0010
  16. 0001
  17.  
  18. Lower triangular matrix: every super-diagonal entry is 0
  19.  
  20. 3000
  21. 1000
  22. 2110
  23. 0479
  24.  
  25. Upper triangular matrix: Every sub-diagonal entry is 0
  26.  
  27. 3114
  28. 0261
  29. 0010
  30. 0009
  31.  
  32. reads from standard input(redirected from input file), an n-by-n matrix, print the type. input file must have positive integer followed by n rows of integers. Exmaple input file contents:
  33.  
  34. 4
  35. 3000
  36. 1000
  37. 2110
  38. 0479
  39.  
  40. then
  41.  
  42. ./matrix <infile
  43.  
  44. should print
  45.  
  46. lower triangular matrix
  47.  
  48.  
  49.  
  50. */
Add Comment
Please, Sign In to add comment