1

What will be output if you will compile and execute the following c code? #include int * call(); int main(){ int *ptr; ptr=call(); printf("%d",*ptr); return 0; } int * call(){ int a=25; a++; return &a; }

Correct Answer: garbage value

Make the most of this question

This page focuses on one Data Structure and Algorithms (DSA) question from Engineering. After checking the answer, return to the topic list to practice more or run a timed set.

Data Structure and Algorithms (DSA) MCQ: What will be output if you will compile and execute the following c code? #include int * call(); int main(){ int *ptr; ptr=call(); printf("%d",*ptr); return 0; } int * call(){ int a=25; a++; return &a; } | Extra Education