Advertisement
STANAANDREY

bitwise add

Oct 29th, 2022
1,595
0
Never
5
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. unsigned add(unsigned a, unsigned b) {
  4.   do {
  5.     unsigned xor = a ^ b;
  6.     unsigned carry = a & b;
  7.     carry <<= 1;
  8.     a = xor;
  9.     b = carry;
  10.   } while (b);
  11.   return a;
  12. }
  13.  
  14. int main() {
  15.   unsigned a, b;
  16.   scanf("%u", &a);
  17.   scanf("%u", &b);
  18.   printf("%u+%u=%u\n", a, b, add(a, b));
  19.   return 0;
  20. }
  21.  
Advertisement
Comments
  • DavidDepape
    2 years
    # text 0.79 KB | 0 0
    1. 29Oct2022_13:12 0bd2..5d72 Another try
    2. 29Oct2022_12:56 001c..fa46 wooooshhhhh!!!!
    3. 29Oct2022_12:55 32cb..9c63 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    4. 29Oct2022_12:54 4948..df8f .♚.
    5. 29Oct2022_12:53 b5cc..f040 WWV
    6. 29Oct2022_12:37 eb87..bdb1 wooooshhhhh!!!!
    7. 29Oct2022_12:36 d908..ac68 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    8. 29Oct2022_12:35 91b5..bedb NEW YORK CRIME BABY wooooshhhhh!!!!
    9. 29Oct2022_12:34 de5d..e7c3 https://sloughbusstationfire.loforo.com
    10. 29Oct2022_04:40 61e3..ebdc wooooshhhhh!!!!
    11. 29Oct2022_04:39 313c..31db $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    12. 29Oct2022_04:38 c65f..befa https://www.imagebam.com/view/MEG43EY
    13. 29Oct2022_04:37 d123..3515 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  • DavidDepape
    2 years
    # text 1.26 KB | 0 0
    1. 27Oct2022_12:48 227b..1977 wooooshhhhh!!!!
    2. 27Oct2022_12:00 e33f..de19 https://kaildganglife.blogspot.com/2011/03/prison-gangs-one-mexican-mafia-v.html
    3. 27Oct2022_11:59 4723..b8fc kaildganglife.blogspot.com/2011/04/prison-gangs-two-black-guerilla-family.html
    4. 27Oct2022_11:56 c17b..026d https://albertsmithirishindependentnewspaper.loforo.com/
    5. 27Oct2022_11:56 033a..687b https://kiearanconwaysolicitors.loforo.com/
    6. 27Oct2022_11:55 fe7f..f013 https://wikileaksworldvapour.loforo.com/
    7. 27Oct2022_10:55 eec6..b073 kiearanconwaysolicitors – Loforo
    8. 27Oct2022_10:54 5fb7..3573 https://kieranconwaysolicitors.loforo.com/
    9. 27Oct2022_10:54 a84b..4800 https://wikifreaks-wikifreaks3.loforo.com/
    10. 27Oct2022_10:53 41f1..2279 https://wikifreaks-wikifreaks2.loforo.com/
    11. 27Oct2022_10:53 3d53..b7f8 https://wikifreaks-wikifreaks1.loforo.com/
    12. 27Oct2022_10:52 2015..5334 https://wikifreaks-wikifreaks.loforo.com/
    13. 27Oct2022_10:51 9938..b81c https://wikifreaksworldvision.loforo.com/
    14. 27Oct2022_10:51 7532..b464 https://wikifreaks2.loforo.com/
    15. 27Oct2022_10:50 5b2a..d6e5 https://wikifreaks1.loforo.com/
    16. 27Oct2022_10:50 c123..c4dc https://wikifreaks.loforo.com/
    17. 27Oct2022_10:46 0120..ac11 http://www.darkpolitricks.com/2022/10/liz-truss-green-screen-zelenskyy-and.html
    18.  
  • DavidDepape
    2 years
    # text 0.82 KB | 0 0
    1. 27Oct2022_08:31 0a6d..fe18 http://paste.org.ru/?em7tj8 Dr Moayyad Al Kamali spy allegations
    2. 26Oct2022_19:40 fb9d..0495 https://kieranconwaysolicitors.loforo.com/
    3. 26Oct2022_19:33 c30d..d797 https://thumbsnap.com/i/FVqKPoEx.jpg
    4. 26Oct2022_19:32 5921..2142 https://thumbsnap.com/i/21bqPREE.jpg
    5. 26Oct2022_19:32 59b4..696f https://thumbsnap.com/i/xCRUA7Bz.png
    6. 26Oct2022_19:31 3285..c1db https://thumbsnap.com/i/FH8GBaqv.png
    7. 26Oct2022_19:31 998a..2ff5 https://thumbsnap.com/i/2uJY3EW3.png
    8. 26Oct2022_19:30 ca14..c2b7 https://thumbsnap.com/i/GBxGDwYY.jpg
    9. 26Oct2022_19:30 d01e..5ea9 https://thumbsnap.com/i/Z1mLdoCf.jpg
    10. 26Oct2022_19:29 612b..138f https://thumbsnap.com/i/9MAUt76K.png
    11. 26Oct2022_19:29 d1df..c884 https://thumbsnap.com/i/qMWBtDD6.jpg
    12. 26Oct2022_19:28 41f8..cf76 https://thumbsnap.com/i/jQVgcjhp.jpg
  • DavidDepape
    2 years
    # text 3.63 KB | 0 0
    1. 23Oct2022_14:41 9c8c..867c http://www.darkpolitricks.com/2020/11/well-done-america-you-voted-for-what.html
    2. 23Oct2022_14:33 5bbe..b345 www.darkpolitricks.com/2020/04/well-it-seems-google-really-didnt-like.html
    3. 23Oct2022_14:32 ed42..e2c8 http://www.darkpolitricks.com/2018/07/israel-is-first-terrorist-state-with.html
    4. 23Oct2022_14:31 b296..0668 http://www.darkpolitricks.com/2021/05/cia-agent-admits-why-usa-cant-have.html
    5. 23Oct2022_14:07 4f95..d812 http://www.darkpolitricks.com/2020/04/help-me-create-real-altnews-search.html
    6. 23Oct2022_14:06 36c5..f4bb http://www.darkpolitricks.com/2020/07/covid19-were-loving-it.html
    7. 23Oct2022_13:45 2b4e..5780 www.darkpolitricks.com/2022/04/who-are-we-standing-with-when-we-stand.html
    8. 23Oct2022_13:44 8483..08e3 http://www.darkpolitricks.com/2022/03/the-stupidity-of-russian-sanctions.html
    9. 23Oct2022_13:42 16a2..10a5 www.darkpolitricks.com/2022/01/how-many-conspiracies-have-to-turn-true.html
    10. 23Oct2022_13:41 a486..74ba darkpolitricks.com/2021/09/the-uk-is-becoming-more-despotic-every.html
    11. 23Oct2022_13:40 4605..9f8e http://www.darkpolitricks.com/2021/12/the-internet-is-dead-can-you-prove-it.html
    12. 23Oct2022_13:35 e899..f184 http://www.darkpolitricks.com/2022/03/two-things-can-be-right-at-same-time.html
    13. 23Oct2022_13:28 d629..79a9 http://www.darkpolitricks.com/2021/03/is-biden-worse-than-trump.html
    14. 23Oct2022_13:27 8885..6d01 http://www.darkpolitricks.com/2022/05/here-comes-world-war-iii.html
    15. 23Oct2022_13:26 6692..546b http://www.darkpolitricks.com/2020/02/am-i-going-down-google-plug-of.html
    16. 23Oct2022_13:02 c9ef..99d3 wooooshhhhh!!!!
    17. 23Oct2022_13:01 32e5..289f https://0000001.onepage.website/
    18. 23Oct2022_12:40 7fea..56ca wooooshhhhh!!!!
    19. 23Oct2022_12:39 27ba..e21f DICE https://images4.imagebam.com/26/a0/30/MEDWGTV_o.jpeg
    20. 23Oct2022_12:39 8db8..1808 DICE https://images4.imagebam.com/fb/ef/3f/MEDWGTZ_o.jpeg
    21. 23Oct2022_12:38 acfb..a06d DICE https://images4.imagebam.com/ea/ea/7d/MEDWGU3_o.jpeg
    22. 23Oct2022_12:36 fa9d..9191 DICE https://images4.imagebam.com/ef/59/32/MEDWGUA_o.jpeg
    23. 23Oct2022_12:31 f86d..4195 You having fun?
    24. 23Oct2022_12:20 3ea8..708c wooooshhhhh!!!!
    25.  
    26. 22Oct2022_17:03 03f2..1b48 https://wikifreaks.loforo.com/httpwwwdarkpolitrickscom202002amigoingdo
    27. 21Oct2022_04:52 af43..55e1 https://pastebin.com/KWcCt4k1#AtE8gHK3
    28. 21Oct2022_04:51 bce5..3b2b https://pastebin.com/rx7APZR1#igUx2TrV
    29. 21Oct2022_04:50 72f2..2cbd https://pastebin.com/pU8msxDa#YbUqmaqQ
    30. 21Oct2022_04:43 f0d1..7369 https://pastebin.com/xdig4G8N#vBcSwaX2
    31. 21Oct2022_04:41 b12e..3330 https://pastebin.com/sRmEiDDk#uYnpL6hC
    32. 21Oct2022_04:40 3374..4782 https://pastebin.com/r7MYt37z#R0NRSY5F
    33. 21Oct2022_04:39 f82f..9375 https://pastebin.com/WcYb6Yqe#iz2nUU08
    34. 21Oct2022_04:38 5259..3824 https://pastebin.com/CBuxJiwz
    35. 21Oct2022_04:38 e70f..e4f1 https://pastebin.com/JTrYm8kx#Dfz4R0w7
    36. 21Oct2022_04:37 d614..7268 https://pastebin.com/9EViet7W#5Cc4NYiH
    37. 21Oct2022_04:36 41d0..38b9 https://pastebin.com/MivvJfSa#ZMmVwcw6
    38. 20Oct2022_17:02 28cd..4ece https://www.imagebam.com/view/GA5URK WikifreakzWorldVizion
    39. 20Oct2022_15:58 376b..ecf9 https://coub.com/wikifreaks
    40. 20Oct2022_15:54 ca03..8a91 https://coub.com/wikifreakzworldvision
    41. 2
    42. 10Oct2022_15:52 b62c..f5b2 Wikifreakz World Vizion W.W.V 16458825
    43. 05Oct2022_15:57 e5a7..effc to be an eternal soldier of chairman mao cats !!!!
    44. 05Oct2022_15:54 aac6..e8a2 https://commons.wikimedia.org/wiki/File:Crypto_Mazeonics.jpg
    45. 05Oct2022_15:49 4aca..6486 https://www.imagebam.com/view/GA5KVR
    46. 05Oct2022_15:23 edae..2cd6 https://www.nairaland.com/search?q=cryptokingz&search=Search
    47. 05Oct2022_14:51 8314..d554 wooooshhhhh!!!!
    48. 20Sep2022_05:33 bd36..f2f7
  • DavidDepape
    2 years
    # text 0.00 KB | 0 0
    1. 1
Add Comment
Please, Sign In to add comment
Advertisement