Home > General Studies (Hindi) > Quizzes > C Programming Practice Test: Structures, Unions and Bit-Fields
C Programming Practice Test: Structures, Unions and Bit-Fields
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 0% Most missed: “What will be the output of the following C code?”
Quiz questions on: Structures basics, functions, arrays of structures, pointer to structires, self referential structures, table lookup, typedefs, unions and bit fields. Structures: A structure is a user-defined data type that allows you to group together related data items. For example, you could create a structure to store information about a person, such as their name, age, and address. To declare a structure, you use the struct keyword followed by the name of the structure and a list of its members. Each member of a structure must have a type and a name. Once you have declared a... Show more
C Programming Practice Test: Structures, Unions and Bit-Fields
Time left 00:00
1 Questions

1. What will be the output of the following C code?
#include
struct student fun(void)
{
struct student
{
char *name;
};
struct student s;
s.name = "alan";
return s;
}
void main()
{
struct student m = fun();
printf("%s", m.name);
}