diff options
Diffstat (limited to 'testapp/docs/sample.c')
-rwxr-xr-x | testapp/docs/sample.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testapp/docs/sample.c b/testapp/docs/sample.c new file mode 100755 index 0000000..660f862 --- /dev/null +++ b/testapp/docs/sample.c @@ -0,0 +1,20 @@ +#include<stdio.h> + +void main(int argc , char * argv[]) +{ + int i,sum=0; + +/* if(argc!=3) + { + printf("you have forgot to type numbers."); + exit(1); + } +*/ + printf("The sum is : "); + + for(i=1;i<argc;i++) + sum = sum + atoi(argv[i]); + + printf("%d",sum); + +} |