Advertisement
Nattack

Untitled

Feb 23rd, 2012
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char **argv)
  5. {
  6.     double sum=0;
  7.  
  8.     if(argc > 1)
  9.     {
  10.         for(int i = 1; i < argc; i++)
  11.             sum+= atof(argv[i]);
  12.         printf("Sum is %f\n", sum);
  13.     } else {
  14.         printf("No Numbers");
  15.     }
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement