NEW
Font size
WorksheetsC Structures
Total questions: 10
Worksheet time: 9mins
Which of the following are themselves a collection of different data types?
String
Struct
char
all
Which operator connects the structure name to its member name?
-
=
.
>>
Which of the following cannot be a structure member?
another structure
array
Function
None
Which of the following structure declaration will throw an error?
struct temp{ } s;
main(){}
struct temp{ };
struct temp s;
main(){ }
struct temp s;
struct temp{ };
main(){ }
None
What is the output of this C code?
void main()
{
struct student
{
int no;
char name[20];
};
struct student s;
s.no = 8;
printf("%d", s.no);
}
Nothing
Compile error
8
Junk
Size of a union is determined by size of the.
First member in the union
Last member in the union
C. Biggest member in the union
Sum of the sizes of all members
Assuming size of long int is 4 bytes, what will be the output for:
typedef long long int L = 24;
printf("Size of long long int is :");
printf("%d",sizeof(L));
24
4
8
Error
What will be the output
Name:
Subject:
Percentage: 86.50000
Name:Raju
Subject:
Percentage: 86.50000
Name: Raju
Subject: Maths
Percentage: 86.50000
Error
Memory allocated for structure members are always contigious
True
False
What do you understand by:
void update(struct student *s);
update is a function that takes an argument as pointer to structure variable and returns nothing
update is a method that takes structure type variable as parameter
Error, we cannot pass structure variable as pointer to a function
update takes pointer argument but it cannot return void
