Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int a;
- int d;
- cin>> a;
- int c = 0;
- //10->2
- while(c<1)
- {
- d = a%2;
- if(d==1)
- {
- cout<<"1";
- a= a-1;
- a= a/2;
- }
- else
- {
- cout<<"0";
- a=a/2;
- }
- if(a<1)
- {
- c =c+1;
- }
- }
- cout<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment