Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C Programming
»
Memory Allocation
What will be the output of the program? #include<stdio.h> #include<stdlib.h> int main() { union test { int i; float f; char c; }; union test *t; t = (union test *)malloc(sizeof(union test)); t->f = 10.10f; printf("%f", t->f); return 0; }
10
Garbage value
10.100000
Error
Show Answer
Correct Answer:
10.100000
← Previous
Next →
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment