Every C-Program must have a function called main() , program execution starts from it. When a program is executed with command line arguments, those are made available to program’s main() function by 2 arguments: 1st argument argc of type int indicates number of arguments 2nd argument *argv[] an array of…