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

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

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

Что будет выведено на экран в результате выполнения приведенной программы?
int main(void){	union pw {	  int i;	  double d;	  char ch[2];	} pw = {121};		printf("pw.ch = %s", pw.ch);		return 0;}

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

Варианты ответа
pw.ch = 1
pw.ch = 121
pw.ch = y(Верный ответ)
при выпонении программы возникнет ошибка, так как элемент pw.ch не инициализирован
Похожие вопросы
Что будет выведено на экран в результате выполнения приведенной программы?
int main(void){	union pw {	  int i;	  double d;	  char ch[2];	} pw = {"y"};		printf("pw.d = %.2f", pw.d);		return 0;}
Что будет выведено на экран в результате выполнения приведенной программы?
int main(void){	union pw {	  int i;	  double d;	  char ch[2];	} pw = {"y"};		printf("pw.i = %d", pw.i);		return 0;}
Используя таблицу кодов ASCII, определите, что будет выведено на экран в результате выполнения приведенной программы?
#include <stdio.h>#define N 7int main(){		int i, j, k, buf;	char arr[N] = "Lection";	for (i=0; i<N; i++)		for (j=0; j<N-1; j++)		{			if (arr[j] > arr[j+1])			{				buf = arr[j];				arr[j] = arr[j+1];				arr[j+1] = buf;			}		};	for (k=0; k<N; k++)		printf("%c ", arr[k]);	return 0;		}
Используя таблицу кодов ASCII, определите, что будет выведено на экран в результате выполнения приведенной программы?
#include <stdio.h>#define N 7int main(){		int i, j, k, buf;	char arr[N] = "Lection";	for (i=0; i<N; i++)		for (j=0; j<N-1; j++)		{			if (arr[j] < arr[j+1])			{				buf = arr[j];				arr[j] = arr[j+1];				arr[j+1] = buf;			}		};	for (k=0; k<N; k++)		printf("%c ", arr[k]);	return 0;		}
Что будет выведено на экран в результате выполнения приведенной программы?
struct student {	char fio[30];	int group;	float average;};struct student Init(char*, int, float);void Print(struct student*);int main(void){	struct student s1, s2, s3, *st;	int i;	s1 = Init("Ivanov I.", 3801, 5.00);	s2 = Init(s1.fio, 4209, 4.50);	s3 = Init("Petrov P", s1.group, s2.average);	st = &s3;	Print(st);	return 0;}struct student Init(char* n, int i, float f){	struct student s, *st;	st = &s;	strcpy(st->fio, n);	st->group = i;	st->average = f;	return s;}void Print(struct student *st){	printf("\nName: %s", st->fio);	printf("\nGrouproup: %d", st->group);	printf("\nAverage mark: %.2f\n", st->average);}
Какое сообщение будет выведено на экран в результате выполненния приведенной программы?
int main (void){	struct student { 		char *name;		char *birthday;		int group;	} s1, s2;	int s;		s1.name = "Ivanov";	s1.birthday = "10.03.1985";	s1.group = 1014;	s2.name = "Petrov";	s2.birthday = "08.04.1985";	s2.group = 1309;	s2 = s1;	if (s2.group == s1.group)		printf("Students %s and %s are studying in the same group\n", s1.name, s2.name);	else		printf("Students %s and %s are not studying in the same group\n", s1.name, s2.name);	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;}
Какое сообщение будет выведено на экран в результате выполненния приведенной программы?
int main (void){	struct student { 		char *name;		char *birthday;		int group;	} s1, s2;	int s;		s1.name = "Ivanov";	s1.birthday = "10.03.1985";	s1.group = 1014;	s2.name = "Petrov";	s2.birthday = "08.04.1985";	s2.group = 1309;	s2.group = s1.group;	if (s2.group == s1.group)		printf("Students %s and %s are studying in the same group\n", s1.name, s2.name);	else		printf("Students %s and %s are not studying in the same group\n", s1.name, s2.name);	return 0; }
Что будет выведено на экран в результате выполнения приведенной программы?
int main(void){	enum coin { penny, nickel, dime, quarter=100, half_dollar, dollar};	enum coin money;	printf("%d ", penny);	printf("%d ", nickel);	printf("%d ", dime);	printf("%d ", quarter);	printf("%d ", half_dollar);	printf("%d ", dollar);		return 0;}
Используя таблицу кодировки символов ASCII, определите, что будет выведено на экран в результате выполнения приведенного фрагмента кода?
	int i = 0;	char t1 = 218;	char tr = 191;	char b1 = 192;	char br = 217;	char g = 196;	char v = 179;	printf("%c", t1);	for (i=0; i<32; i++) printf("%c",g);	printf("%c\n", tr);	printf("%c", v);	for (i=0; i<32; i++) printf("%c",' ');	printf("%c\n", v);	printf("%c", b1);	for (i=0; i<32; i++) printf("%c",g);	printf("%c\n", br);