ADD USING COMMAND LINE ARGUMENTS.
#include<stdio.h>
#include<stdlib.h>
int main(int argc,char *argv[])
{
int i, sum = 0;
if (argc < 3)
{
printf("<--Please Enter at least 3 argument to execute this Proggram-->");
exit(0);
}
else
{
for(i = 0 ; i < argc ; i++)
{
sum = sum + atoi(argv[i]);
}
printf("Addition of entered arguments is = %d",sum);
}
return 0;
}
0 Comments