Command Line Arguments

Learn command line arguments with the help of an interactive example.

Passing command line arguments under a Linux environment

We have provided the source for the C program. When you press the RUN button, it will open the terminal for you. RUN the following commands in the given terminal to compile and execute the given program:

  • gcc main.c -o main.out
  • ./main.out 10 20 30

Get hands-on with 1400+ tech skills courses.