InterviewSolution
Saved Bookmarks
| 1. |
Write a program to get the higher and lower nibble of a byte without using shift operator? |
|
Answer» #include<stdio.h>STRUCT full_byte{char first : 4;char second : 4;};union A{char x;struct full_byte by;};MAIN(){char c = 100;union A a;a.x = c;PRINTF("the two nibbles are: %d and %d\n", a.by.first, a.by.second);} |
|