Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
Technical Questions
»
Programming
What will output when you compile and run the following code? #include struct student { int roll; int cgpa; int sgpa[8]; }; void main() { struct student s = { 12,8,7,2,5,9 }; int *ptr; ptr = (int *)&s; clrscr(); printf( "%d", *(ptr+3) ); getch(); }
8
7
2
Compiler error
Show Answer
Correct Answer:
2
← Previous
Next →
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment