 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how we can count wall and consonants available in a string by passing string into 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 Techness, which is available on Google Play. Now coming on to the explanation here, I will be implementing the solution of this problem with the help of C programming. So first time including a header file. Now I'm declaring a function whose return type is void. Name of this function is count and it will receive an argument that is character array. So this statement is function declaration. After that I am defining main function. Inside main function, I am declaring a character array. Now with the help of printf, the message enters string or you can say enter name will be displayed on console. Now you have to remember that while executing this program, you just have to enter alphabets only. It can be uppercase letter or it can be lowercase letter, but you have to enter only alphabets. If you enter digits and spatial symbols, then we cannot count those input which are digits and spatial symbols as wall and consonants. So to read the input that is provided by the user, I am using GATUS function. Now I am calling count function where I am passing str string. So this is function calling statement and at last return 0. Now I am defining definition of count function. This block will be known as function definition. So inside this function, I have to define the logic how we can count wall and consonants available in a string. So I am declaring a variable I then C1 which is initialized with 0, C2 is initialized with 0. Now I am applying a for loop which is initialized with 0. Its condition is str of I not equals to null and then I plus plus. Now inside this loop, I have to check whether the entered string containing alphabets or not. So first I am checking that then I will be checking how many wall and consonants are available inside it. So I am applying if condition which will check whether the entered character is alphabet or not. So for that purpose, I am using this condition str of I greater than equals to 65 and str of I less than equals to 90. So this is first condition. Now I am applying or another condition that is str of I greater than equals to 97 and str of I less than equals to 122. So now you can see I have implemented two situations. This first situation is for checking whether the entered character is uppercase. If it is uppercase then this if condition will be true because I am using or here but if this first condition is false then second condition will be checked. So this second condition will be checking whether the string is containing lowercase letter or not. So if any one of these condition is true then this if will be considered as true otherwise it will become false. And these 65 and 90 and 97 and 122 these are ask a value range for uppercase and lowercase respectively. So if this first condition is true then inside this I am applying another if. So this is nested if. So here I am checking str of I double equals to a or str of I double equals to e or str of I double equals to I or str of I double equals to o or str of I double equals to u. So I have compared str of i with a, e, i, o, u that are available in uppercase and notice that I have mentioned all the character constants in single quotes. So you have to individually check all the walls which are available in a string and I have separated all conditions with logical or. So if any one of these condition is true then string is containing wall otherwise it is containing consonant. Now if you want to check for lower case then you have to write it five times more. So now I am copying this condition and I am pasting it. Now I am converting this a into small a, p into small e, i into small i, o into small o and u into small u. So this way I have implemented this complete condition. So I have implemented this condition. If this is true then I am counting c1 plus plus and if it is false then I am counting c2 plus plus. So this way you can see first I have checked whether the string is containing alphabet or not whether it is uppercase or lowercase it doesn't matter but it should be an alphabet. So if first if condition is true then second it will be checked and is the second condition is checking whether the string is containing upper sorry wall or consonant. So after completion of this loop I can print counted values which are available in c1 and c2 on console. So I am printing ball equals to percent d slash n consonants equals to percent d then c1 comma c2. So this way I have implemented the complete code in front of you. Now I am going to execute this code I am entering Sanjay. So you can see my name contains two walls a, a. So walls are two and remaining characters are treated as consonants. So the program is working properly it is showing correct results. Now again I am executing this code this time I am entering mixed input s, a, 2, 3, percent then y. So you can see the output it is showing wall one that is a and consonant two that is s and y. It is not counting 2, 3 and percent so it is ignoring desert sense spatial symbol because I have applied this if condition which is available on line number 19. So because of this condition it is only checking whether the character is alphabets sorry it is only checking whether the content is alphabet or not. So if content is alphabet then only it will be checking it will be checked for wall or consonant otherwise not. So I hope you have understood how we can count wall and consonant by passing string into function. If you want to watch more programming related videos you can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tech school. You can download my programming app Techimace that is available on Google Play. Thank you for watching this video.