Consider the following program. Change the program so that the output of printf is always 10. It is not allowed to change main(). Only fun() can be changed.
We can use Macro Arguments to change the output of printf.
This article is contributed by Abhay Rathi. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Nested printf (printf inside printf) in C
- Is it fine to write "void main()" or "main()" in C/C++?
- Difference between "int main()" and "int main(void)" in C/C++?
- C/C++ program for calling main() in main()
- What is use of %n in printf() ?
- Use of & in scanf() but not in printf()
- How to print % using printf()?
- Passing NULL to printf in C
- Cin-Cout vs Scanf-Printf
- Execution of printf with ++ operators
- Return values of printf() and scanf() in C/C++
- puts() vs printf() for printing a string
- What is the difference between printf, sprintf and fprintf?
- What does main() return in C and C++?
- Can main() be overloaded in C++?
- Executing main() in C/C++ - behind the scene
- Functions that are executed before and after main() in C
- return statement vs exit() in main()
- How to write a running C code without main()?
- C/C++ program to print Hello World without using main() and semicolon