Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, nr[9],i = 0;
- cin>>n;
- while(n != 0)
- {
- nr[i] = n%2;
- i++;
- n = n/2;
- }
- for(int j = i-1; j >= 0; j--)
- cout<<nr[j];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement