 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can print reverse of a number using macro in C programming. Before starting, you can note how you can search my YouTube channel. You can type my name Sanjay Gupta in YouTube. My channel will be available there. You can watch various programming related videos here. So in this video, I will be demonstrating how you can print reverse of a number using macro. So for that purpose, first I am including a header file that is stdio.h. Now I am going to define a macro whose name is REV that is reverse. Now I am going to define its replacement token list. So it will be having three statements inside curly basis. So these are three statements which are enclosed in curly basis with wild condition. So after completion of this loop, reverse will be displayed on output screen with the help of the printf statement. So this way I have defined a macro whose name is REV reverse. Its parameter is n and then I have defined its replacement token list, which is a code which will calculate reverse of a particular number. Now I am going to define main function. So here I have declared all the variables which I have used in the macro. Now with the help of printf and scanf, I am going to read a number from user and that number will be stored inside n variable. Now for macro, I have used this statement REV and I have passed n as parameter. So this macro is used at line number 9. So this statement which is available at line number 9 will be replaced with the replacement token list which is available at line number 3 at the time of compilation automatically. So now I am going to compile and execute this code. So you can see it is asking for a number. So I have entered 1, 2, 3, 4. It is showing the output 4, 3, 2, 1 which is the reverse of the number. So this way I have successfully calculated the reverse of a number. Now suppose if you want to reuse this macro, that is also possible. So after using macro first time, I have re-initialized as with 0. Then again this printf will be displaying enter a number. Number will be received in n and at line number 13 macro is reused. So again I am executing this code. It is asking for a number. I am entering 1, 2, 3, 4. It is showing the result 4, 3, 2, 1. Again it is asking for another number. So I have entered 5, 6, 7, 8. So it is showing 8, 7, 6, 5 which is its reverse. So this way we can use macro any number of times as it is required in our program. So I hope you have understood how we can calculate reverse of a number with the help of macro. So I have implemented whole while loop in macro statement. So you can use any particular statement in macro with the help of has defined whatever you want to use. I hope you have understood whatever I have demonstrated you in this video. If you want to watch more programming related videos, you can search my name Sanjay Gupta. My channel will be available there. You can also download my programming app TechMains which is available on Google Play. Thank you for watching this video.