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
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Nested printf (printf inside printf) in C
- Difference between "int main()" and "int main(void)" in C/C++?
- C/C++ program for calling main() in main()
- Is it fine to write "void main()" or "main()" in C/C++?
- How to print % using printf()?
- What is use of %n in printf() ?
- Passing NULL to printf in C
- Cin-Cout vs Scanf-Printf
- Execution of printf with ++ operators
- What is the difference between printf, sprintf and fprintf?
- Use of & in scanf() but not in printf()
- puts() vs printf() for printing a string
- Return values of printf() and scanf() in C/C++
- return statement vs exit() in main()
- Functions that are executed before and after main() in C
- How to print "GeeksforGeeks" with empty main() in C, C++ and Java?
- Can main() be overloaded in C++?
- How to write a running C code without main()?
- Executing main() in C/C++ - behind the scene
- Print "Hello World" with empty or blank main in C++