hi. how can a decimal value be converted to binary in a c++ program?
iqra aslam
0
Newbie Poster
Recommended Answers
Jump to PostThe easiest way is to use bitset
#include <iostream> #include <bitset> int main () { std::bitset<16> foo(123); std::cout << foo << '\n'; return 0; }
All 4 Replies
Sarkurd
0
Junior Poster in Training
iqra aslam
commented:
plz send me the code
+0
マーズ maazu
2
Light Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
Sam_6
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.