Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int nPes=64,nValor;
- printf("Introdueix un nombre en binari: ");
- scanf("%d",&nValor);
- while(nPes){
- if(nValor>=nPes){
- nValor-=nPes;
- printf("1");
- }
- else{
- printf("0");
- }
- nPes/=2;
- }
- printf("\n");
- return 0;
- }
Add Comment
Please, Sign In to add comment