 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how to use conditional operator question mark in colon in 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. Now I am going to implement a code in front of you which will demonstrate you how you can use conditional operator in macros in C. So first I am including header file stdio.h. Now I am going to define a macro whose name is Max. It will receive two parameters A and B. And I am implementing this macro with the help of hash defined preprocessor. So now I have to implement its replacement token list. So for that purpose, I am going to use conditional operators. So here you can see this A greater than B is a condition. If this condition is true, then this A will work. Otherwise B will work. So these A and B are placed with the help of question mark and colon. So this complete statement is implementing conditional operator. And this will be replaced wherever I will be using max macro with two parameters. So this is a macro statement which is using conditional operator. Now I am going to define main function where I will be using this macro. So I have declared three integer variables A, B and C. With the help of this print tab, the message enter two numbers will be displayed on output screen. And this scanf will be reading two values from user in A and B variables. Now I am going to use macro whose name is max. So this max A comma B will be replaced with this replacement token list that is A greater than B, question mark A colon B at the time of compilation. So the result will be assigned into C. So I can print the result on output screen with the help of this printf and C variable. So this way I have implemented macro in this program and that macro is using conditional operator. Now I am going to execute this code. It is asking for two numbers. So I am entering 50 as first number and 100 as second number. So you can see the output. It is showing max equals to 100. So it is working properly. So I hope you have understood how we can use conditional operator in macros in C programming. If you want to watch more programming related videos, you can search my name Sanjay Gupta in YouTube. My channel will be there. You can also download my programming app Tagimace which is available on Google Play. Thank you for watching this video.