Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Th3 PyRom4n --> Startimes <--- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- #include <math.h>
- void main()
- {
- int N,Nmax,i,t[100],c ;
- printf("entrer un nombre en decimal \n ");
- scanf("%d",&N);
- Nmax=log(N)/log(2);
- c=N;
- for(i=1;i<=Nmax+1;i++)
- {
- t[i]=N%2 ;
- N/=2;
- }
- printf("le nombre %d en binaire est :",c);
- for(i=Nmax+1;i>O;i--)
- {
- printf("%d",t[i]);
- }
- printf("\n\n\n\n\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment