Analizar La Salida

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

ANALIZAR LA SALIDA

Informar qué se muestra en pantalla


1-)

#include <stdio.h>
struct BITS {
int A:9; char B:2; unsigned char C:3; char D:1;
};
union UN {
struct BITS bit; unsigned int dato;
};
void main()
{ union UN X ;
X.dato = 19719;
printf("\ndato= %d ", X.dato);
printf("\nA=%d B=%d C=%d D=%d", X.bit.A, X.bit.B, X.bit.C , X.bit.D);
}

*****************************************************************************
2-)

#include <stdio.h>
struct BITS {
int A:5; char B:8; unsigned char C:1; char D:2;
};
union UN {
struct BITS bit; unsigned int dato;
};
void main()
{ union UN X ;
X.A = -12;
X.B= X:A >>2;
X.C=-1; X.D=-1;
printf("\nA=%d B=%d C=%d D=%d", X.bit.A, X.bit.B, X.bit.C , X.bit.D);
}

******************************************************************************
3-)

struct BITS { int A:3; char B:5; };


union UN { struct BITS bit; unsigned int dato; };

void main0
{ union LIN X ;
X.bit.A : 33;
X.bit.B= -23>>2;
printf( "\ndato= %x ", X.dato);
}

You might also like