База ответов ИНТУИТ

Программирование на языке C в Microsoft Visual Studio 2010

<<- Назад к вопросам

Чему будет равно значение переменной c после выполнения приведенной программы?
int main(void){	struct test {		unsigned int a : 2;		unsigned int b : 8;	};		int c;	struct test t;	t.b = 255;	t.a = 3;	c = t.b | t.a;	printf("c = %d\n", c);	return 0;}	

(Отметьте один правильный вариант ответа.)

Варианты ответа
0
63
252
255(Верный ответ)
Похожие вопросы
Чему будет равно значение переменной c после выполнения приведенной программы?
int main(void){	struct test {		unsigned int a : 2;		unsigned int b : 8;	};		int c;	struct test t;	t.b = 255;	t.a = 3;	c = t.b ^ t.a;	printf("c = %d\n", c);	return 0;}	
Чему будет равно значение переменной t.a после выполнения приведенной программы?
int main(void){	struct test {		unsigned int a : 2;		unsigned int b : 8;	};		int c;	struct test t;	t.b = 255;	t.a = t.b & 3;	printf("t.a = %d\n", t.a);	return 0;}	
Чему будет равно значение переменной b в результате выполнения приведенной программы?
int main(void){	struct Options {		unsigned int  centerX : 1;		unsigned int centerY : 1;		unsigned int shadow : 2;		unsigned int palette : 4;	};		int b;	struct Options t, *pt;	t.shadow = 12;	t.palette = 10;	b = t.shadow + t.palette;	printf("b = %d\n", b);	return 0;}	
Чему будет равно значение переменной b в результате выполнения приведенной программы?
int main(void){	struct Options {		unsigned int  centerX : 1;		unsigned int centerY : 1;		unsigned int shadow : 2;		unsigned int palette : 4;	};		int b;	struct Options t, *pt;	t.shadow = 10;	t.palette = 12;	b = t.shadow + t.palette;	printf("b = %d\n", b);	return 0;}	
Чему будет равно значение переменной b в результате выполнения приведенной программы?
int main(void){	struct Options {		unsigned int  centerX : 1;		unsigned int centerY : 1;		unsigned int shadow : 2;		unsigned int palette : 4;	};		int b;	struct Options t, *pt;	t.shadow = 10;	t.palette = 10;	b = t.shadow + t.palette;	printf("b = %d\n", b);	return 0;}	
Определите, содержит ли приведенная программа ошибки? Если содержит, укажите, какие именно?
int main(void){	struct test {		unsigned int  : 3;		unsigned int f1 : 1;		unsigned int f2 : 1;		unsigned int f3 : 1;		unsigned int type : 8;		unsigned int index : 18;	};		int b;	struct test t, *pt;	pt = &t;	pt->f1 = 11;	t.type = 3439;	b = t.f1 + t.type;	printf("b = %d\n", b);	return 0;}
Определите, содержит ли приведенная программа ошибки? Если содержит, укажите, какие именно?
int main(void){	struct test {		unsigned int  : 3;		unsigned int f1 : 1;		unsigned int f2 : 1;		unsigned int f3 : 1;		unsigned int type : 8;		unsigned int index : 18;	};		int a : 4, b;	struct test t;	t.type = 3439;	b = a + t.type;	//printf("t.type = %d\n", t.type);	return 0;}		
Чему будет равно значение переменной str после выполнения приведенной программы?
union test {  char ch1[5];  char ch2[2];  char ch3[1];};int main(void){	union test t;	char *str;	strcpy(t.ch1, "test");	t.ch2[0] = 'b';	t.ch3[0] = 'w';	str = t.ch1;	return 0;}
Чему будет равно значение переменной s после выполнения приведенного фрагмента кода?
int test();int a = 1;int main (void) {	int b, s;	extern int x;	static int c;	int a;	a = 2;	s = test();	return 0;  }int test() {	int t = a;	return t;}
Чему будет равно значение переменной str после выполнения приведенной программы?
union test {  char ch1[5];  char ch2[2];  char ch3[1];};int main(void){	union test t;	char *str;	strcpy(t.ch1, "test");	strcpy(t.ch2, "be");	t.ch3[0] = 'w';	str = t.ch1;	return 0;}