NEW
Font size
WorksheetsSTUCTURES
Total questions: 25
Worksheet time: 25mins
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
How do you initialize an array in C?
int arr[3] = (1,2,3);
int arr(3) = {1,2,3};
int arr[3] = {1,2,3}
int arr(3) = (1,2,3)
What is the output of C Program.?
int main()
{
int a[] = {1,2,3,4};
int b[4] = {5,6,7,8};
printf("%d,%d", a[0], b[0]);
}
1
2
4
Error
What is the output of C Program.?
int main() {
int a[] = {1,2,3,4};
int b[4] = {5,6,7,8};
printf("%d,%d", a[0], b[0]);
}
1,5
2,6
0,0
Error
What is the output of C Program.?
int main()
{
char grade[] = {'A','B','C'}; printf("GRADE=%c, ", *grade); printf("GRADE=%d", grade);
}
GRADE=some address of array, GRADE=A
GRADE=A, GRADE=some address of array
GRADE=A, GRADE=A
Compiler error
What is the output of C program.?
int main() {
char grade[] = {'A','B','C'}; printf("GRADE=%d, ", *grade); printf("GRADE=%d", grade[0]);
}
A A
65 A
65 65
None
What is the output of C program.?
int main()
{
float marks[3] = {90.5, 92.5, 96.5};
int a=0;
while(a<3)
{
printf("%.2f,", marks[a]); a++;
}
}
90.5 92.5 96.5
90.50 92.50 96.50
0.00 0.00 0.00
Compiler error
What is the output of C program with arrays and pointers.?
int main() {
int a[3] = {20,30,40};
int *p[3];
p=&a;
printf("%d", *p[0]); }
20
address of element 20
Garbage value
Compiler error
In the C language, the constant is defined _______.
Before main
After main
Anywhere, but starting on a new line
None
Who invented C Language.?
Charles Babbage
Grahambel
Dennis Ritchie
Steve Jobs
C Language is a successor to which language.?
FORTRAN
D Language
BASIC
B Language
C is a which level language.?
Low Level
High Level
Low + High
none
C language was invented in which laboratories.?
Uniliver Labs
IBM Labs
AT&T Bell Labs
Verizon Labs
A C program is a combination of.?
Statements
Function
variables
all
An Identifier may contain.?
Letters a-z, A-Z in Basic character set.
Unicode alphabet characters other languages
Underscore _ symbol
Numbers 0 to 9
Unicode Numbers in other languages
All the above
Find an integer constant.
3.145
34
"125"
None of the above
