Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <stdint.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4.  
  5. int main(const int argc, const char * argv[]){
  6. int32_t x, y;
  7. if (argc < 3){
  8. fprintf(stderr,"Usage: %s num1 num2\n",argv[0]);
  9. exit(1);
  10. }
  11.  
  12. x = atoi(argv[1]);
  13. y = atoi(argv[2]);
  14.  
  15. if (y <= 0){
  16. return 0;
  17. }
  18.  
  19. if (x + y < x){
  20. printf("Overflow happens!\n");
  21. }
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement