1
00:00:05,910 --> 00:00:12,630
Now we have it as if statements, so this is also similar to statement, but weekend you might improve

2
00:00:12,630 --> 00:00:20,070
conditions, say if accommodation is met, then bad conditions it blog will be executed, then we have

3
00:00:20,370 --> 00:00:22,650
to begin on another condition.

4
00:00:22,860 --> 00:00:27,910
If this condition is not true, it will check this condition and if it is true, then it will execute

5
00:00:27,910 --> 00:00:28,530
that block.

6
00:00:29,730 --> 00:00:33,750
Then if both of these conditions are not true, then it will execute that.

7
00:00:33,900 --> 00:00:34,710
In a statement.

8
00:00:34,890 --> 00:00:40,500
So multiple levels of as simple as possible, like if one condition is not met, you can check on another

9
00:00:40,500 --> 00:00:41,050
condition.

10
00:00:41,100 --> 00:00:45,000
Again, you can read my motors is defined by another condition and ticket.

11
00:00:45,300 --> 00:00:53,550
Similarly, you can have multiple conditions and if any of these conditions are met, that will be executed

12
00:00:53,730 --> 00:00:58,290
if not meant that last year's blog will be executed.

13
00:00:58,560 --> 00:01:00,810
We will see this program in action.

14
00:01:01,030 --> 00:01:04,770
Do I understand the concept, a concept of if statements?

15
00:01:05,400 --> 00:01:13,890
So here again, see that this one also flowchart, but also so it will execute that condition.

16
00:01:14,130 --> 00:01:16,950
If it is true, it will execute that conditions body.

17
00:01:17,130 --> 00:01:22,110
If it is false, it will text the next expression and then it is.

18
00:01:22,110 --> 00:01:27,540
If it is true, it will execute that body and it will again go to the condition.

19
00:01:27,540 --> 00:01:33,930
Check if that on my brain, like if first statements coming up, this will go on like this.

20
00:01:33,930 --> 00:01:37,830
So if it is a fine, it as a condition, we are objecting.

21
00:01:37,920 --> 00:01:41,280
If it is not true, then it will go to that statement.

22
00:01:43,400 --> 00:01:47,230
Then we have one more type of your statement, which is quite nice, steady.

23
00:01:47,660 --> 00:01:54,680
So instead of, it's actually simple concept if we are having a condition and it is coming through and

24
00:01:54,680 --> 00:02:03,020
then inside that if we are checking for another condition and if that is true, we are executing that

25
00:02:04,160 --> 00:02:08,720
block of statements that kind of these statements are part nested if statement.

26
00:02:08,840 --> 00:02:17,690
So I would be willing to somebody if I am comparing to values, yeah, greater, then we then surely

27
00:02:17,960 --> 00:02:25,970
we need to execute this so we can say that I am again comparing if we're greater than C, then you have

28
00:02:25,970 --> 00:02:34,220
to execute this statement, which means like if a is greater than me, then only this can broadly get

29
00:02:34,220 --> 00:02:35,570
into this if block.

30
00:02:35,840 --> 00:02:39,200
Then from there it will check for you greater than see.

31
00:02:39,890 --> 00:02:43,190
Then only it will go to this block and execute that values.

32
00:02:43,340 --> 00:02:50,270
If this is true, then it will execute this block if this condition becomes false, if there are any

33
00:02:50,270 --> 00:02:53,180
other statement inside this block, it will execute that.

34
00:02:53,360 --> 00:02:58,880
If ward this conditions are not true, then it will go to the end of this block.

35
00:02:58,940 --> 00:03:00,080
So that is why we use.

36
00:03:00,290 --> 00:03:05,150
If any of you understood that, maybe I gave you a symbolic summary.

37
00:03:05,390 --> 00:03:13,700
I have file as here and I have three asked me and I have four asks See?

38
00:03:15,030 --> 00:03:17,490
So far, greater than three is through.

39
00:03:17,520 --> 00:03:25,650
So it comes to this statement then taking fire Great Britain SEISS four five events for that is also

40
00:03:25,650 --> 00:03:33,570
true, then it will print it if I am writing print here, print, they're just citing print, not looking

41
00:03:33,570 --> 00:03:35,970
at this index and all just to make you understand.

42
00:03:36,720 --> 00:03:41,340
So if I'm writing Print Day here, then it will print that despair.

43
00:03:41,880 --> 00:03:46,080
But if it is not in the case, it be six.

44
00:03:46,980 --> 00:03:49,470
If B six five greater than six is four.

45
00:03:49,500 --> 00:03:56,670
So this will not enter a dollar in this block, so it will not execute the coming statement after that.

46
00:03:57,390 --> 00:04:06,080
Suppose if these six, not six means three and C's six, then what that means five greater than three

47
00:04:06,080 --> 00:04:06,570
is true.

48
00:04:06,930 --> 00:04:11,810
Then it will end and the block, then it will take four or five grand plan six expires.

49
00:04:12,000 --> 00:04:18,270
So this if statement will be skipped and if there are any statement, I would say that that will be

50
00:04:18,390 --> 00:04:19,110
executed.

51
00:04:21,660 --> 00:04:28,170
Similarly, we can use street statement if they want to have it condition checking.

52
00:04:28,350 --> 00:04:32,490
If I have a lot of condition to check, then I can use this.

53
00:04:32,610 --> 00:04:40,890
So it's an alternative to if as if suppose if I have a very variable rate and if like a variable can

54
00:04:40,890 --> 00:04:41,820
be anything right.

55
00:04:42,090 --> 00:04:49,680
So if those variable is matching to any of the constants on the seats, then it will actually execute

56
00:04:49,680 --> 00:04:51,570
that that case.

57
00:04:51,580 --> 00:04:57,030
So it will be like if switch, we will have any variable on expression order.

58
00:04:57,080 --> 00:05:05,220
Yet it is the case one or case match is that if that case is true, then it will execute that statement

59
00:05:05,580 --> 00:05:09,720
or set up that statements and go to that in block.

60
00:05:10,470 --> 00:05:15,540
If that is not conditional statement, then we are checking second condition.

61
00:05:15,720 --> 00:05:21,780
If it is true, it will go to the second set of statements and it will execute and go to that end of

62
00:05:21,780 --> 00:05:22,040
it.

63
00:05:22,320 --> 00:05:26,760
But there are like 10 conditions and one and two on an argument.

64
00:05:26,970 --> 00:05:33,450
So if it is like the third one is meant, then it will go to that statement number three and execute

65
00:05:33,450 --> 00:05:38,130
that like that it will execute which condition is actually meant.

66
00:05:38,610 --> 00:05:44,910
That will be true and then back, but will be executed if none of the conditions are true.

67
00:05:45,360 --> 00:05:50,670
We have it be false statement and which will execute before statement.

68
00:05:50,790 --> 00:05:57,310
So how we can see this, we can see it in action in a program, then generally we'll get more idea switch.

69
00:05:57,450 --> 00:06:01,920
So let's see every one of those concept in action.

70
00:06:02,130 --> 00:06:03,980
Let's go to our demo session.

71
00:06:12,000 --> 00:06:19,650
So in order to help you understand the concept of if statements I have it program over here would give

72
00:06:19,650 --> 00:06:20,340
statements.

73
00:06:21,020 --> 00:06:24,210
Suppose I have to pray.

74
00:06:25,770 --> 00:06:32,700
And I'm like a month corresponding to the month, so January one, foster Monday, February 2nd.

75
00:06:33,180 --> 00:06:41,520
So if a user is inputting the value of and one that is fine, it means me, then that should be printed.

76
00:06:41,610 --> 00:06:48,180
So this is the program which will actually show the month the name according to that month the number.

77
00:06:48,540 --> 00:06:55,500
And this is using the concept of if there's if so, you can see out here, I have all that important

78
00:06:55,710 --> 00:06:57,210
parts of the program ready.

79
00:06:57,450 --> 00:07:05,120
Then I am declaring the value to get the number of the month that is and then I am printing the number,

80
00:07:05,130 --> 00:07:07,800
then I am asking for that one, the number again.

81
00:07:09,120 --> 00:07:12,770
So you will know that if any call the one, it means it's January.

82
00:07:12,780 --> 00:07:18,300
So you have to get the output generated, if any or do you have to get February?

83
00:07:18,420 --> 00:07:22,560
So here you can see how beautifully I had used the concept of effect.

84
00:07:23,310 --> 00:07:28,080
So if any one then print January, yes.

85
00:07:28,080 --> 00:07:36,750
If this is the same next year, if an equal to two, so the condition is to check in equal to two,

86
00:07:37,230 --> 00:07:39,510
if that is met, then print February.

87
00:07:39,690 --> 00:07:48,450
Similarly, Abdul 0:48 I have this April's block and lastest as part because I don't have any more condition

88
00:07:48,450 --> 00:07:48,870
to check.

89
00:07:49,230 --> 00:07:54,060
Just check if the number is not equal to any of this one to 12.

90
00:07:54,240 --> 00:08:00,980
Then it means like you also have given back month number only the right input is 11:59, right?

91
00:08:01,140 --> 00:08:06,960
If any number is coming out, say that there is no money associated with it, so we have to print any

92
00:08:06,960 --> 00:08:08,010
false statement card.

93
00:08:08,190 --> 00:08:11,900
Yes, see our invalid number and please try.

94
00:08:12,180 --> 00:08:14,570
So that's the message we will be printing.

95
00:08:14,580 --> 00:08:21,120
So we will be just putting ads at Dallas because there is no father condition to check and then we will

96
00:08:21,120 --> 00:08:25,290
be ending that program so we can see this program in action.

97
00:08:25,630 --> 00:08:27,510
Two that I will be clearing make.

98
00:08:27,510 --> 00:08:31,440
I'm so like first and then I will be executing the program.

99
00:08:31,470 --> 00:08:35,220
So why does the command for compiling the program?

100
00:08:36,670 --> 00:08:40,930
It is G Plus Plus space.

101
00:08:41,290 --> 00:08:43,450
What is a program name, right?

102
00:08:43,600 --> 00:08:44,620
Filing if?

103
00:08:45,460 --> 00:08:50,410
Statement CBP, not CBP.

104
00:08:50,410 --> 00:08:51,310
That's my file name.

105
00:08:51,310 --> 00:08:52,120
I am campaigning it.

106
00:08:53,420 --> 00:08:57,710
No, IRA's, if there are any of us there, we will take lot of messages coming in between.

107
00:08:57,930 --> 00:09:00,930
But my program is correct so that I don't know, I guess.

108
00:09:00,950 --> 00:09:03,320
No, I can't execute the program.

109
00:09:04,210 --> 00:09:05,690
Dot slash it out.

110
00:09:07,940 --> 00:09:09,480
See, it's asking me for the month.

111
00:09:09,500 --> 00:09:09,920
No.

112
00:09:10,220 --> 00:09:13,800
So let me give you the 10 as the no end.

113
00:09:14,180 --> 00:09:15,350
So it's October, right?

114
00:09:15,560 --> 00:09:21,830
So that satellite value we have got because what happened in West End?

115
00:09:22,070 --> 00:09:24,380
So I checked here, it is not true.

116
00:09:24,590 --> 00:09:26,870
So it said the next condition, it is not true.

117
00:09:27,020 --> 00:09:30,250
Similarly, went down and checked that condition.

118
00:09:30,250 --> 00:09:30,620
No.

119
00:09:31,750 --> 00:09:39,610
And right, that just any time, so there is a match, so it executed that statement on that locally.

120
00:09:40,030 --> 00:09:43,030
All of that block didn't execute.

121
00:09:43,990 --> 00:09:46,870
So hope you have answered this.

122
00:09:47,140 --> 00:09:48,640
So now we can move to that.

123
00:09:49,780 --> 00:09:55,930
Late one more time, I will execute this program and see if I'm executing, if I'm giving any number

124
00:09:56,080 --> 00:09:58,260
outside of the 12 part would happen.

125
00:09:58,270 --> 00:09:59,510
So that's one, right?

126
00:09:59,680 --> 00:10:06,770
So we can execute it, dodge slash and our dog and I will be giving them on December 14 invalid.

127
00:10:07,190 --> 00:10:09,210
No, please try again, right?

128
00:10:09,580 --> 00:10:11,830
Say destroying the right output.

129
00:10:14,090 --> 00:10:17,300
So now let's move to that sweet statement.
