 Hello friends, I am Sanjay Gupta. In this video I am going to demonstrate you how we can print a string using %s and %c format specifiers. 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 TechMS which is available on Google Play. Now I am going to implement a code in C programming so that I can demonstrate you the use of %s and %c format specifiers to print a string. So first I am including a header file that is stdr.h. Then I am defining main function. Inside main I am declaring a character array str and then increase the variable i. To receive a string I am displaying the message enter string on console with the help of printf and the entered string will be stored inside str using getters. So after reading process I am implementing printf which will display the message you have entered equals to %s and then str. So this is the first method through which I can print the string on console and here you can see in this method I have used %s inside printf. So if we use printf and %s then we can print the content of string on console. So I am executing this code. I am entering my name Sanjay. So you can see the output it is showing you have entered equals to Sanjay. So the %s is working properly. So this is the first method of printing string. Now I am applying second method. So the message will be another way of printing string equals to. So this is another way for this purpose I am initializing for loop with i equals to 0 then str of i is not equals to null. This is the termination condition of loop and then i++. Inside this loop I am applying printf which will display single single characters on console. So you can see loop is started from 0 its condition is str of i not equals to null. So if this condition is true it means string index is not containing null value then only string content will be displayed on console using %c then i++ will be performed. So this way loop will repeat until null character is available. So this is the second method through which you can print content of a string character by character on console using %c format specifier. So it will show two outputs one from %s and one from %c. So again I am entering my name Sanjay you can see the output first is printing you have entered. So this output is because of %s and second output another way of printing string equals to is printed using printf and then Sanjay is printed with the help of this for loop which is available in front of you. So friends I hope you have understood how we can print a string on console with the help of %s and %c. So %s doesn't require any loop it can print a string without any loop till string is containing characters and null is not available. If null is occurred then printing is terminated but if you are using %c then you require a particular loop. So that contains can be printed on console character by character. So I hope you have understood both the methods well. If you want to watch more programming related videos you can follow or subscribe my YouTube channel through the URL youtube.com slash Sanjay Gupta underscore tax school. You can download my programming app Techimage which is available on Google Play. Thank you for watching this video.