Programming and speech.
So why we're hosting suites, it's more easy to give the condition compared to these fair statement.
So we have written if there's a program here, right?
But we have to use if then a condition and or the one any good to everything we have to repeat.
N.A. n.a. n.a. The three languages we have to repeat this condition for checking the same number and
repeatedly the later condition, and you have to be more specific in that.
So switch games as, say, kind of a shortcut to help us to check the conditions.
So that's why we use that switch statement.
So I have returned the same program to display kind of month name, according to the month, the number
using switch statements.
Let's see how it's more efficient.
Here you can see I haven't declared I have month number.
I am asking for them number.
Then I am using suites.
So just providing yen into the switch.
So what happens?
Whatever input you send, use it will come to that switch statements.
So if it is one, then it will go the case.
What if it is due, it will go to the case.
If it is three, it will go to the case.
Similarly, I have the cases up to 10 right and there is a default case are safe in any of the cases
is not matching.
Then I can even add on a stage that is invalid.
Number, please try again.
So switch makes our life more easier compared to if I see a statement.
So what about the execution of the program?
Let's try compiling this and executing this.
Is there any difference between the execution?
Let's see.
So I'm trying to campaign this program, G Plus Plus Switch.
E G e e c, b b CBB tender, no eye on us in my program, so that's why it's actually campaigned successfully
now.
Let's try Strader output, not slash in tandem.
Seats asking me for them my number, and I'm due February, it's the right answer, I'm executing this
program again and giving I value, I would say the month.
No, it's 17.
It's asking me in that number.
Please try again.
See, both programs are given me have given me same output.
What about the efficiency of programs?
This is more simple.
I need more to write, check and eager to.
One n.a. n.a. three.
And there is no need to write if as if any subversive like that, right?
It's only eight one.
What should be the output, if it is one, is the number march and we now put the two is the No.
Similarly, you can give any kind of constant and is not a number.
It means an integer.
Then or so you can actually go with that straight statements.
That's the beauty of using suite statements compared to compared to the given statements.
So more have the same.
Help us to do the same logic makes it just more efficient.
So that is a small exercise for you.
Try writing some more programs or finding out some more programs which have been written using speech
statements and see how we can leverage on sweet statements for like doing something more easy compared
to.
Our different statements.
So the end of this section also.