ProAnswers.org

C Program to show use of command line arguments

#include
#include
#include
void main(int argc,char *argv[])
{
int sum=0,i;
//if wrong number of command line arguments
if(argc<3)
{
printf("Incorrect number of arguments:
");
getch();
return 0;
}
//Add all the numbers entered using atoi function
for(i=1;i