fork download
  1. echo "Enter Number"
  2. read n
  3. echo "Enter The Array"
  4. for((i=0 ; i < $n ; i++))
  5. do
  6. read nos[$i]
  7.  
  8. for((i=0 ; i < $n ; i++))
  9. do
  10. for((j=$i ; j < $n ; j++))
  11. do
  12. if((${nos[$i]} -gt ${nos[$j]}))
  13. then
  14. t = ${nos[$i]}
  15. nos[$i] = ${nos[$j]}
  16. nos[$j] = $t
  17. fi
  18. done
  19. done
  20. echo "Array is: "
  21. echo $arr[*]
Runtime error #stdin #stdout #stderr 0s 19632KB
stdin
Standard input is empty
stdout
Enter Number
Enter The Array
stderr
./prog.sh: line 22: syntax error: unexpected end of file