Addition of number using cla (command line arguments)
/*C Program to add numbers using command line arguments(CLA)*/
void main(int argc,char *argv[])
{
int sum=0,i;
//Compare if proper number of arguments have been entered
if(argc<3)
{
printf("Insufficient number of arguments:\n");
getch();
return 0;
}
//Add all the numbers entered using atoi function
for(i=1;i<argc;i++)
print="" the="" sum="" ans="%d",sum);" h="">
/*C Program to add numbers using command line arguments(CLA)*/
void main(int argc,char *argv[])
{
int sum=0,i;
//Compare if proper number of arguments have been entered
if(argc<3)
{
printf("Insufficient number of arguments:\n");
getch();
return 0;
}
//Add all the numbers entered using atoi function
for(i=1;i<argc;i++)
print="" the="" sum="" ans="%d",sum);" h="">
0 comments: