The output generated by the LINUX command : $ seq 1 2 10 will be

2014

The output generated by the LINUX command :

    $ seq 1 2 10

will be

  1. A.

    1 2 10

  2. B.

    1 2 3 4 5 6 7 8 9 10

  3. C.

    1 3 5 7 9

  4. D.

    1 5 10

Attempted by 45 students.

Show answer & explanation

Correct answer: C

Key idea: seq uses the form START INCREMENT END and prints numbers from START to END using INCREMENT as the fixed step.

  • Syntax: seq START INCREMENT END

  • For seq 1 2 10: START = 1, INCREMENT = 2, END = 10.

  • Generated values: 1 (start), 1 + 2 = 3, 3 + 2 = 5, 5 + 2 = 7, 7 + 2 = 9. The next value would be 11, which is greater than the END value 10, so generation stops.

  • Final output: 1 3 5 7 9

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…