16. Comment on the output of the following C code. #include struct temp { int a; int b; int c; main04 struct t

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

16. Comment on the output of the following C code. #include struct temp { int a; int b; int c; main04 struct t

Post by answerhappygod »

16 Comment On The Output Of The Following C Code Include Stdio H Struct Temp Int A Int B Int C Main04 Struct T 1
16 Comment On The Output Of The Following C Code Include Stdio H Struct Temp Int A Int B Int C Main04 Struct T 1 (36.64 KiB) Viewed 53 times
16 Comment On The Output Of The Following C Code Include Stdio H Struct Temp Int A Int B Int C Main04 Struct T 2
16 Comment On The Output Of The Following C Code Include Stdio H Struct Temp Int A Int B Int C Main04 Struct T 2 (32.7 KiB) Viewed 53 times
16 Comment On The Output Of The Following C Code Include Stdio H Struct Temp Int A Int B Int C Main04 Struct T 3
16 Comment On The Output Of The Following C Code Include Stdio H Struct Temp Int A Int B Int C Main04 Struct T 3 (29.2 KiB) Viewed 53 times
16. Comment on the output of the following C code. #include <stdio.h> struct temp { int a; int b; int c; main04 struct temp p[] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; } a) No Compile time error, generates an array of structure of size 3 b) No Compile time error, generates an array of structure of size 9 c) Compile time error, illegal declaration of a multidimensional array d) Compile time error, illegal assignment to members of structure 17. What will be the output of the following C code? a) 10 (Garbage Value) b) 0 10 #include <stdio.h> struct temp c) 100 d) (Garbage Value) 10 { int a; }s; void func(struct temps) { s.a = 10; printf("%d\t", s.a); } main() { func(s); printf("%d\t", s.a); }

18. What will be the output of the following C code? #include <stdio.h> a) alan alan alan turing struct student b) alan alan turing turing c) alan turing alan turing char *name; d) run time error }; struct student s[2]; void main() { S[@].name "alan"; s[1] S[@]; printf("%s%s", s[@].name, s[1].name); S[1].name "turing"; printf("%s%s", s[0].name, $[1].name); } 19. What will be the output of the following C code? a) Compile time error #include <stdio.h> b) 3 struct point { int x; c) 2 int y; void foo(struct point"); int main() { struct point pi[] = {1, 2, 3, 4); foo(p2); } void foo(struct point p[]) { printf("%d\n", p[1].x); }

20. What will be the output of the following C code? a) Compile time error b) 1 c) 0 d) Undefined #include <stdio.h> struct point { int x; int y; }; struct notpoint { int x; int y; }; void foo(struct point); int main() { struct notpoint p1 = {1, 2}; foo(p1); } void foo(struct point p) { printf("%d\n", p.x); }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply