RicardasSim

the difference between two unsigneds

Apr 17th, 2019
681
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main (int argc, char **argv){
  5.  
  6. unsigned int a, b, result;
  7.  
  8. a = 1;
  9. b = 20;
  10.  
  11. if(a>b) result = a - b;
  12. else result = b - a;
  13.  
  14. printf("%d\n", result);
  15.  
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment