Udfør en &-operation med et tal med de nederste 4 cifre i 1, så de fire bits kan bevares
#include "stdafx.h" #include <stdio.h> int main(int argc, char* argv[]) {usigneret a,b,c,d; printf("indtast venligst a:"); scanf("%o",&a); b=a>>4; c=~(~0<<4); d=b&c; printf("%o,%d\n%o,%d\n",a,a,d,d,d;d); return 0;
}
|