It is possible to pass some values from the command line to your C programs when they are executed. These values are called command line arguments.
We can’t use any input functions like scanf(), getch(), getchar().
The input to be provided should be read as command line arguments.
main() function of a C program accepts arguments from command
line or from other shell scripts by following commands.
They are argc and argv
argc – Number of arguments in the command line
including program name (integer).
argv – This is carrying all the arguments including
program name (pointer array ).
int main(int argc, char *argv) //command line arguments
printf(“\n Program name : %s \n”, argv);
printf(“1st arg : %s \n”, argv);
printf(“2nd arg : %s \n”, argv);
Here some easy problem that you can practice.
This course is an early bird release. More programs will be added in the coming days
If you are familiar with C programming, but you are not able to understand or write C program for a given problem, then this course helps in improving your coding skills.
In this course, 100 + C programs of different levels are explained clearly with pseudo code and tracing with sample inputs . After solving 100+ C programs, you will get a solid foundation in Coding.