What code to write in place of “// your code” so that the below code prints 20.
We strongly recommend you to minimize your browser and try this yourself first
This question seems to be a trick question, as it is not possible to update local variable in a function without sending it, we can’t make value of ‘a’ as 20 but for outputting 20 we can write function f as below –
2 will be printed by f() and 0 will be printed by a
Thanks to Utkarsh Trivedi for suggesting above solution.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
- A C/C++ Pointer Puzzle
- A C/C++ Function Call Puzzle
- A C Programming Language Puzzle
- A nested loop puzzle
- Introduction to the C99 Programming Language : Part I
- Jagged Array or Array of Arrays in C with Examples
- Introduction to the C99 Programming Language : Part III
- Introduction to the C99 Programming Language : Part II
- Features of C Programming Language
- Difference between Increment and Decrement Operators
- Problem in comparing Floating point numbers and how to compare them correctly?
- exit(0) vs exit(1) in C/C++ with Examples
- Predefined Macros in C with Examples
- How to create GUI in C programming using GTK Toolkit