• 2 days ago
Transcript
00:00Hello everyone. Now this is the program of switchcase and here I have used the data type
00:11char with the variable a. So I am going to input a character value. Now if you see that
00:21this is the program almost same as the one which I have explained in my last video. In
00:27that I have taken the data type int okay but here I have taken the variable char okay.
00:35So the case only the difference is that if you see here the case in the case I have used
00:43the alphabets a in spite of using numbers I have used alphabet a, b, c like this okay
00:51and these characters are close in a single quote okay. So only this is the difference
01:02and the specifier which I have used the type specifier that is what %c as I have to store
01:08the character value. So when I store here inside I should take here x so there should
01:14not be any confusion okay. I take here x so when I input to the value inside this x
01:22variable suppose I input what here x suppose I input a inside this x okay so inside a it
01:33is what x inside x it is what a. So inside the x variable I am going to input what a
01:41so suppose if I input inside this x variable what a so it's going to take me to this case
01:47a so it will take me to the label a and it will display what welcome. So let us click
01:53on build and see is it this correct program it's showing me zero error and zero warning
02:00let us run and input the value a here so it's shown me what welcome and from the break statement
02:10the case will end. I am going to run it again with some other case suppose I put c here
02:19so it's going to display come again okay. This is the program of it. In the next video
02:32I will create some more programs of such case. Thanks.

Recommended