include stdafx include stdio include conio include windows include loc

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "stdafx.h"
#include <stdio.h>
#include <conio.h>
#include <windows.h>
#include <locale>
struct pole
{
unsigned i1:1;
char:1;
unsigned i2:1;
char:1;
unsigned i3:1;
char:1;
unsigned i4:1;
char:1;
unsigned i5:1;
char:1;
unsigned i6:1;
char:1;
unsigned i7:1;
char:1;
unsigned i8:1;
char:1;
};
int main(int) // вычисление остатка от деления на 2 , 4
{
setlocale(LC_ALL,"rus");
printf("Введите число\n");
pole *pl;
char k;
scanf("%d",&k);
pl=(pole *)&k;
printf("\n %d",pl->i1);
printf("\n %d",pl->i2);
printf("\n %d",pl->i3);
printf("\n %d",pl->i4);
printf("\n %d",pl->i5);
printf("\n %d",pl->i6);
printf("\n %d",pl->i7);
printf("\n %d",pl->i8);
getch();
}