Hey, guys, what's up?
So today we are solving one more investing problem.
So that probably one treatment is will be given an alphabet.
OK.
So we will be given an alphabet use.
It will give us an alphabet.
Or you can say use.
It will give us a character.
And we have to print where that character is uppercase.
Whether that word is uppercase or lowercase.
Otherwise, we have to print in reality, connecter.
For example, if my input is, let's say, be so, our approach should be uppercase.
If my input is let's say it's small C, my output should be lower keys and let's say if I give one as
input, so output should be invalid.
Correct.
OK, so this is the task that we have to perform.
And this is very easy.
So what I'm going to do is I will take a character, C.H..
GABSI h and I will take input from the user.
Then I'm going to do is I will check for a parkis.
So if my character is good, then Articles two Capital E and my character is less than Articles two,
Capital Z.
Then I can safely say that my correct dosage is up parkis.
OK.
Similarly elusive, if my character is a girl, then articles too small a and my character is less than
articles too small Z, then I can safely say that my character is lowercase.
And if both these conditions are false, if this is false, this is false.
I will reach in as bloke.
And here I will brained that my character is an invalid character.
OK.
So this is all that we have to do.
OK, so landside called.
So I have already made a file up, a lower dot CPB.
And now what I'm gonna do is I will take a character, S.H. and the value of S.H. really be given by
user.
Now, I just know I have to just right a fence.
So if my character is good, then capitally and.
My character is less than or equal to Capital Z.
Hey, it will be great.
Then ordered close to.
So if this is the condition I can see see out of Parkis.
And Lane.
I save.
I will check if my character is a better than or equal to Smally and my character is less than or equal
to small Z, then my character is a lower case, lower case alphabet.
So C, I would lower case.
As if both dubeau condition are false, that means the given character is not an alphabet and.
It is an invalid correct bird.
So invented character.
So let us test our program.
Nurses smaller, so lower case.
Let's say, gee.
Lowercase.
Now, let's say Capital said.
Parkis.
And now let does give an invalid character lives here, too.
So it is an invalid character.
Now, the obvious thing that you may be thinking is.
So what is the thing that you should think?
How we can compare it to correctors.
OK.
We can compare two numbers to Gordon three, Tager, then five.
But how we can compare two numbers that Eger then be how we can compare.
This is a character.
There is no way in which we can compare two characters.
So how this logic is working.
So the idea is very simple.
This operator is defying phone numbers and floating, floating in the mud and in beaches.
And these are characters, so implicit typecasting is taking place here.
OK, so this so this variable sea, it is containing a character and that character's converted into
its Sky-Blue.
Similarly, Smally is converted to its eye skyway, which is 97, similarly.
There that is 122.
So all the characters and variables, for example, S.H. is a variable and this is a character.
So the of variable containing the character is converted includes Wickwire value.
Similarly, Z will be converted and ask you.
And we are comparing those oskay values.
OK.
So we are comparing those Wickwire.
So some of the civil order you must remember is capitalises and 65 beas 66 and so on.
Similarly I think Z will be.
Sixty five plus twenty five.
So five and five, ten, six plus two is 1890, so Z will be 90.
Similarly small 97.
B is 98.
And so on.
And Z will be 97.
Plus strong five.
So 122.
So these are Scavullo.
You should remember they're used in many cushions.
So it is better to remember these values.
So where you can also do here.
Instead of I capitally, you can ride, it's asked, will you also 65, similarly, instead of riding
Capital Z, what you can do here is you can write ask Amy, Lou and Sam for this.
97.
And went on to do because ultimately typecasting was taking place and this girl is also typecasting,
will take implicit typecasting.
OK, so this is implicit typecasting.
We are not converting characters, doing features.
It is done automatically by the compiler.
OK, so this is in blizzard type casting.
So you can check out Prado's going going to be seeing, for example, capital G.
Parraguez.
Similarly.
Let's say small G.
Lower case and same for invalid characters.
OK.
So this is it for this video.
Thank you for watching.