 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how to read strings including spaces using scanf function. Before starting, you can note my information. You can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tech school. You can download my programming app tech image which is available on Google Play. Now coming onto the topic. In this video, I am going to demonstrate you how you can read strings including spaces using scanf. So normally scanf doesn't read any blank spaces, but in this video, you will be learning how we can do this. So for that purpose, first I am including a header file as tdi.h. Then I am defining main function. Inside main, I am declaring a character array. Then with the help of printf, I am going to display the message enter string on console. To read string, I am using %s and then str. Now I am going to display the enter string on console with the help of this printf. So the message you have entered equals to %s and then comma str. So this output will be displayed on console and then return 0. So here you can see I have used scanf normally using %s. So let's see what happens. So I am entering sanjaygupta. You can see the output is you have entered equals to sanjay. So scanf is not reading space and the content which is available after space. So now I have to modify this scanf so that I can read whole string including space. So notice that I am using square brackets then carrot sign and backslash n. So here you have to understand this carefully. Here this carrot sign is showing that you can enter any character except backslash n. So this carrot sign is showing that except backslash n, you can enter any particular character. Whether it is uppercase, whether it is lowercase, whether it is digit or whether it is spatial symbol or you can say space. So space is also a spatial symbol. So it can read space as well. But it will be terminated when you will be entering backslash n that is enter key. So except enter key, it can read any particular character entered by the user. So now I am executing this quote again and I am entering sanjaygupta. So you can see the output is you have entered equals to sanjaygupta. So this time string is received including spaces. So this way I hope you have understood how we can read strings including spaces using scanf. So this is the way through which you can read strings including spaces. I hope you have understood the difference between scanf percent s and scanf percent square brackets except slash n. So this is reading strings including spaces and previous scanf can only read string excluding spaces. So implement this concept in your system so that you can understand the difference well. I hope you have understood both the differences which I have shown you in this video. If you want to watch more programming related videos, you can follow or subscribe my YouTube channel through the URL youtube.com. You can download my programming app TechMS which is available on Google Play. Thank you for watching this video.