 Hello friends, I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to explain how you can count alphabets, digits and spatial symbols. Those are available in our stream. And in case of alphabets, we will be counting uppercase and lowercase separately. So we need to identify four entities, uppercase, lowercase, digit and spatial symbols. So before starting of the explanation, I want to share my information. If you go to detail or description of this video, you will find links or various playlists related to C programming. So you can follow them if you want to learn programming or want to watch more programming related videos. So now I'm going to start the implementation. So, so first of all, I'm going to declare character added. Let's say str scientist 20. Then I'm going to declare four variables, C1, C2, C3 and C4 and all are initialized with zero. So C1 will be having counter uppercase, C2 for lowercase, C3 for digit and C4 for spatial symbols. And one more variable will be required. I, that is for counting or iterating the loop. Then I'm writing a printer statement which will display a message enter string. Then Gattus will read the entered string into str. Now I'm going to iterate a loop. So for i equals to zero, loop condition will be depending upon the null position. So if str of i is not equals to null, then this loop will repeat. If it is equals to null, then it will be permanent. So now inside this loop, I need to apply the logic so that I can count uppercase lowercase. So I'm writing if str of i greater than equals to capital A and str of i less than equals to capital Z. So this way, alpha bits uppercase will be completed. So str of i will be having a particular character. So let's say this is our character array. And here I am mentioning D, here small d, here let's say 8, here hash and then null. So one uppercase, one lowercase, one digit and one spatial symbol and then null. So when we will be on zero index, so it is having capital D. So str of i, this will be replaced in capital D. Then it will be compared with capital A and here it will be compared with capital Z. So if D is greater than equals to A and D is less than equals to Z, then this condition will be true. Now you will be thinking how they will be compared. So here one more thing arises that is ASCII value. So it stands for American Standard Code for Information Interchange. And we have this ASCII code for capital A to Z. So here what will happen, this capital D will be converted into its ASCII code. A will be converted into its, again D will be converted and Z will be converted. So based on these numerical values this comparison will be perfect. So the ASCII value of D will be greater than A. It is true and ASCII value of D will be less than capital Z ASCII value. So this statement will be true. So here I can put C1 plus plus. Now here in place of this, in place of writing capital A and capital Z into single codes, you can technically put their ASCII codes as well. 65 and 90. So if you remember the ASCII codes, you can put them. If you don't remember then you can put a particular character in single codes. So always remember if you are putting any character directly. So you need to put single code to make it as a constant. So I am removing these things. And if this will be true, so C1 will be incremented. Then else if str of i greater than equals to small a and str of i less than equals to small z. Then C2 will be incremented. And if you want to know their ASCII codes, so it is 97 to 112. So in place of small a, you can write 97 in place of small z, you can write 112. Now else if str of i greater than equals to, now here I am putting 0 in single code. So 0 is also considered as character if you put single codes. And str of i less than equals to 90. Then C3 plus plus. And if you want to put ASCII codes of 0 to 9, so it is 48 to 57. So 0 to 9, these are digits. They are also used as numbers. But if we put them in single code, so they are considered as characters. And as C4 plus plus. So if input character is not exist in this range, not in this range, not in this range. So it means it is not uppercase, not lowercase, not with it. So it will be always a spatial symbol. So this way, this for loop is completed. So it will repeat till this null. When null occurs, it will be terminated. And all the countings you can print to print them. So you can write four percenties. And if you want to mention some message, you can also put that. Then C1, C2, C3 and C4. And then you can close your main function. So C1 will print uppercase counting, C2 lowercase count, C3 digit count and C4 spatial symbol count. And also remember this, these are very important. So other than this, other than uppercase, lowercase and digits, whatever as they both are there, they belong to spatial symbols. So this way, I hope you understood how we can count how many uppercase, lowercase digits and spatial symbols are available in a string. So I hope you understood whatever I explained in this video. If you want to watch more programming related videos, open my channel, go to playlist or go to detail or description of this video and find various links of things together. So thank you for watching this video.