Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(){
- int i,a,x,b;
- printf("Ingrese el numero que desea transformar a gray: ");
- scanf("%d",&x);
- for(i=0;i<=x;i++){
- a=i>>1;
- b=a^i;
- printf("\nCodigo gray de %d es: %d",i,b);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment