C Programming - Arrays of Structures
Question 1
|
The correct syntax to access the member of the ith structure in the array of structures is? Assuming: struct temp { int b; }s[50];
s.b.[i];
| |
s.[i].b;
| |
s.b[i];
| |
s[i].b;
|
Question 2
|
Comment on the output of this C code?
No Compile time error, generates an array of structure of size 3
| |
No Compile time error, generates an array of structure of size 9
| |
Compile time error, illegal declaration of a multidimensional array
| |
Compile time error, illegal assignment to members of structure
|
Question 3
|
Which of the following uses structure?
Array of structures
| |
Linked Lists
| |
Binary Tree
| |
All of the mentioned
|
Question 4
|
What is the correct syntax to declare a function foo() which receives an array of structure in function?
void foo(struct *var);
| |
void foo(struct *var[]);
| |
void foo(struct var);
| |
None of the mentioned
|
Question 5
|
What is the output of this C code? (Assuming size of int be 4)
4
| |
12
| |
16
| |
Can’t be estimated due to ambigous initialization of array
|
Question 6
|
What is the output of this C code?
alan alan alan turing
| |
alan alan turing turing
| |
alan turing alan turing
| |
Run time error
|
Question 7
|
What is the output of this C code?
alan alan
| |
Compile time error
| |
Varies
| |
Nothing
|
Question 8
|
What is the output of this C code?
alan alan
| |
Nothing
| |
Compile time error
| |
Varies
|
Question 9
|
What is the output of this C code?
2
| |
4
| |
8
| |
0
|
Question 10
|
What is the output of this C code?
Compile time error
| |
3
| |
2
| |
1
|
Question 11
|
What is the output of this C code?
1
| |
2
| |
3
| |
Compile time error
|
Question 12
|
What is the output of this C code?
1 2
| |
22
| |
Compile time error
| |
Undefined behaviour
|
Question 13
|
What is the output of this C code?
1 0
| |
Compile time error
| |
1 somegarbagevalue
| |
Undefined behaviour
|
Question 14
|
What is the output of this C code?
Compile time error
| |
1 0
| |
1 somegarbagevalue
| |
None of the mentioned
|
Question 15
|
What is the output of this C code?
Compile time error
| |
1 0
| |
1 somegarbagevalue
| |
Undefined behaviour
|
Question 16
|
What is the output of this C code?
Compile time error
| |
1 0
| |
1 somegarbagevalue
| |
undefined behaviour
|
Question 17
|
What is the output of this C code?
2
| |
4
| |
16
| |
8 |
Check Your Answers:
1. D
2. A
3. D
4. A
5. B
6. A
7. C
8. C
9. D
10. B
11. A
12. B
13. A
14. C
15. A
16.B
0 comments:
Post a Comment