Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C++ Compiler.
- Code, Compile, Run and Debug C++ program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <iostream>
- #include <bitset>
- using namespace std;
- int main()
- {
- uint16_t test1 = 255;
- uint16_t test2 = 128;
- uint16_t result= test1;
- result = test1+((test2 &128)<<1);
- std::cout << "a = " << std::bitset<8>(test1) << std::endl;
- std::cout << "a = " << std::bitset<8>(test2) << std::endl;
- std::cout << "a = " << std::bitset<16>(result) << std::endl;
- std::cout << "a = " << result << std::endl;
- cout<<"Hello World";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment