Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int decimal;
- int reste;
- int binaire = 0;
- int i = 1;
- scanf("%d",&decimal);
- while (decimal != 0)
- {
- reste = decimal%2 ;
- binaire = binaire + reste * i;
- decimal = decimal / 2;
- i = i * 10;
- }
- printf("binaire : %d \n",binaire);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement