Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char *argv[])
  4. {
  5. int a,b,sum;
  6. if(argc!=3)
  7. {
  8. printf("please use \"prg_name value1 value2 \"\n");
  9. return -1;
  10. }
  11.  
  12. a = atoi(argv[1]);
  13. b = atoi(argv[2]);
  14. sum = a+b;
  15.  
  16. printf("Sum of %d, %d is: %d\n",a,b,sum);
  17.  
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement