1
00:00:02,660 --> 00:00:04,280
Hey, guys, what's up?

2
00:00:04,700 --> 00:00:08,540
So today we are going to solve a very simple and interesting problem.

3
00:00:08,900 --> 00:00:16,880
So the problem statement is given a Farenheit value, we have to convert it into it, corresponding

4
00:00:17,000 --> 00:00:17,900
saltiest value.

5
00:00:18,410 --> 00:00:18,650
OK.

6
00:00:18,950 --> 00:00:23,150
So the families Celsius equals five by nine.

7
00:00:25,640 --> 00:00:27,470
Fahrenheit minus 32.

8
00:00:28,190 --> 00:00:31,110
So this is the formula for converting a given Fahrenheit.

9
00:00:31,130 --> 00:00:33,150
Will you do it Celsius value?

10
00:00:33,680 --> 00:00:33,920
OK.

11
00:00:34,400 --> 00:00:37,070
So user will give us the value of Fahrenheit.

12
00:00:37,160 --> 00:00:40,580
And I will print its corresponding Celsius value.

13
00:00:41,810 --> 00:00:42,060
OK.

14
00:00:42,380 --> 00:00:44,300
So let's write Colford.

15
00:00:52,170 --> 00:00:53,910
So let's nghiem this vitalize.

16
00:00:57,450 --> 00:01:04,050
Fahrenheit to Celsius, not CBP.

17
00:01:16,680 --> 00:01:28,700
Hash include your stream using namespace SDD and Main.

18
00:01:35,290 --> 00:01:35,530
Done.

19
00:01:35,930 --> 00:01:36,290
Zero.

20
00:01:37,170 --> 00:01:37,300
OK.

21
00:01:37,460 --> 00:01:38,530
So what I have to do.

22
00:01:41,920 --> 00:01:50,020
OK, so what I have to do, first of all, let's create a variable and Farenheit and let us take the

23
00:01:50,020 --> 00:01:52,510
value of Farenheit and Bird from the user.

24
00:01:54,850 --> 00:01:59,800
Now we will calculate Celsius, which is equal to.

25
00:02:01,790 --> 00:02:10,820
Five by nine and two Fahrenheit minus 32.

26
00:02:12,110 --> 00:02:16,630
And after calculating Celsius value, we just have to print it out.

27
00:02:20,350 --> 00:02:22,450
OK, so this is all that we have to do.

28
00:02:23,140 --> 00:02:28,600
We are taking input and then we are calculating the Celsius value with the help of this formula.

29
00:02:29,200 --> 00:02:31,540
And then we are printing the soldiers value.

30
00:02:32,200 --> 00:02:33,460
So let's blend in.

31
00:02:35,140 --> 00:02:39,620
So I think for fair nightclothes hindered my output.

32
00:02:39,670 --> 00:02:40,480
Her T7.

33
00:02:41,950 --> 00:02:44,260
Oh, it's coming out to be zero.

34
00:02:45,580 --> 00:02:47,800
So let's see where this coming out to be zero.

35
00:02:51,160 --> 00:02:51,880
OK, so.

36
00:02:53,790 --> 00:02:56,160
I give Hundert as input.

37
00:02:59,360 --> 00:03:08,780
So a hundred minus 32 is 68 and five by nine and 268 is in articles to zero.

38
00:03:09,890 --> 00:03:11,670
Then why this coming out to zero?

39
00:03:12,890 --> 00:03:21,590
So in the last class, I told you that integer upon integer is an integer visored.

40
00:03:21,590 --> 00:03:24,470
So because this division operator.

41
00:03:26,120 --> 00:03:27,410
Is an inbuilt function.

42
00:03:27,470 --> 00:03:28,300
It is inward.

43
00:03:28,770 --> 00:03:28,990
OK?

44
00:03:29,360 --> 00:03:37,010
So it is defined in such a way that if you divide integer by another integer, the output will always

45
00:03:37,010 --> 00:03:38,060
be an integer.

46
00:03:39,340 --> 00:03:39,560
OK.

47
00:03:39,910 --> 00:03:41,370
So it is defined in such a manner.

48
00:03:42,400 --> 00:03:44,590
And here, focus on this part.

49
00:03:46,480 --> 00:03:52,150
So five by nine is actually zero point five five five five five five.

50
00:03:52,900 --> 00:03:58,210
But I told you that it will give me integer, so I output will be zero.

51
00:03:59,240 --> 00:04:03,880
OK, so five by nine is it goes to zero and zero.

52
00:04:03,900 --> 00:04:07,940
Multiply it by anything as it goes to zero.

53
00:04:09,290 --> 00:04:09,530
OK.

54
00:04:10,040 --> 00:04:11,570
So I hope you understood the problem.

55
00:04:12,410 --> 00:04:14,010
Now how we can resolve it.

56
00:04:14,750 --> 00:04:16,880
So first of all, this is wrong.

57
00:04:17,060 --> 00:04:17,910
Let's come out.

58
00:04:18,860 --> 00:04:22,160
So there are many ways to correct this problem.

59
00:04:23,420 --> 00:04:31,720
So the first raise in sales years equals first.

60
00:04:31,780 --> 00:04:32,510
What do we do?

61
00:04:32,660 --> 00:04:33,560
We will multiply.

62
00:04:34,040 --> 00:04:35,420
And then we will divide.

63
00:04:35,750 --> 00:04:36,050
OK.

64
00:04:36,290 --> 00:04:37,370
So first multiply.

65
00:04:37,850 --> 00:04:38,510
Then divide.

66
00:04:39,200 --> 00:04:40,070
So five.

67
00:04:42,050 --> 00:04:46,250
And do Fahrenheit minus two.

68
00:04:46,440 --> 00:04:48,030
And now we will do divide.

69
00:04:55,350 --> 00:04:56,420
Divide, weigh nine.

70
00:04:57,770 --> 00:04:59,480
OK, so let's Ballenden.

71
00:05:03,380 --> 00:05:10,840
So let's give hundred as input, and today seven is my answer, correct answer.

72
00:05:11,730 --> 00:05:13,700
Okay, so there is one more interesting.

73
00:05:14,750 --> 00:05:19,580
So there is one more way with the help we get, with the help of which we can solve this problem.

74
00:05:24,320 --> 00:05:31,700
To what we will do in the last class, I also told you that in the last class, I also told you that

75
00:05:32,330 --> 00:05:43,250
flawed, divided by integer is an integer, sorry, flawed and similarly integer divided by a flawed.

76
00:05:44,490 --> 00:05:45,940
It's also flawed.

77
00:05:46,660 --> 00:05:49,340
So this division operator is defined in such a manner.

78
00:05:50,740 --> 00:05:53,920
So we can use it how what we will do.

79
00:05:54,100 --> 00:06:04,520
We will write five point zero divided by nine and then we will multiply it with Fahrenheit minus 32.

80
00:06:05,400 --> 00:06:05,610
OK.

81
00:06:06,190 --> 00:06:07,040
So what will happen?

82
00:06:07,450 --> 00:06:15,760
This part, which is flawed upon integer, will give me a floating value and flawed and to endanger

83
00:06:16,600 --> 00:06:18,460
will be flawed.

84
00:06:19,360 --> 00:06:19,670
OK.

85
00:06:19,840 --> 00:06:23,230
So my output will not be zero and output will be a correct.

86
00:06:23,710 --> 00:06:24,820
Output will be correct.

87
00:06:25,450 --> 00:06:25,700
OK.

88
00:06:26,080 --> 00:06:27,640
So we just have to do minor changes.

89
00:06:27,670 --> 00:06:38,300
We will simply write and Celsius equals five point zero divided by nine and two Fahrenheit minus 32.

90
00:06:39,010 --> 00:06:44,710
What you can also do is instead of writing this, you can also write five divided by nine point zero

91
00:06:45,900 --> 00:06:49,540
or you can also write five point zero divided by nine point zero.

92
00:06:51,220 --> 00:06:53,620
So the these three are the same.

93
00:06:53,630 --> 00:06:54,880
You can write any of them.

94
00:06:57,240 --> 00:06:59,450
Okay, so but we have to do one more thing.

95
00:07:02,380 --> 00:07:12,970
So when I'm writing in Celsius equals five point zero, divided by nine into Fahrenheit, minus 32.

96
00:07:13,480 --> 00:07:21,490
So this value is a floating value and floating into each year and flowed into integer will be a floating

97
00:07:21,490 --> 00:07:21,910
value.

98
00:07:23,020 --> 00:07:27,940
So the Right-Hand side is a floating value and left hand side is an integer value.

99
00:07:29,830 --> 00:07:30,760
Is indeed strange.

100
00:07:31,060 --> 00:07:31,930
So what do we have to do?

101
00:07:31,990 --> 00:07:33,120
We have to typecast it.

102
00:07:33,850 --> 00:07:36,800
So for typecasting, we have to do explicit typecasting.

103
00:07:37,300 --> 00:07:38,040
So we'll just.

104
00:07:38,050 --> 00:07:38,470
Right.

105
00:07:38,950 --> 00:07:41,050
And before this expression.

106
00:07:43,240 --> 00:07:43,540
OK.

107
00:07:44,110 --> 00:07:46,400
So why there's a need of typecasting here?

108
00:07:47,110 --> 00:07:51,520
Because the right hand side is a floating value and the left hand side is an integer.

109
00:07:51,880 --> 00:07:55,290
So we have to typecast floated a type into NBG editor type.

110
00:07:57,450 --> 00:08:00,320
OK, so let's make some changes.

111
00:08:01,790 --> 00:08:07,130
So I have come into this part because this is correct.

112
00:08:07,250 --> 00:08:10,820
Let's see one more so in Celsius.

113
00:08:11,960 --> 00:08:15,550
So we have to typecast and why we need to typecast.

114
00:08:15,650 --> 00:08:22,770
Because right hand side is floating value and Left-Hand Side is a integer value.

115
00:08:23,000 --> 00:08:25,190
So 5.0.

116
00:08:26,500 --> 00:08:28,810
Divided by nine.

117
00:08:30,340 --> 00:08:36,730
And then we were multiplied with Fahrenheit minus 32.

118
00:08:38,240 --> 00:08:38,490
OK.

119
00:08:39,370 --> 00:08:44,320
So for typecasting, we have to add black kids.

120
00:08:45,190 --> 00:08:46,090
Now, this is correct.

121
00:08:46,390 --> 00:08:46,990
So let's.

122
00:08:47,180 --> 00:08:47,710
Ballenden.

123
00:08:50,020 --> 00:08:55,660
So 400 miles, but would be 37, which is hundred percent correct.

124
00:08:55,860 --> 00:08:56,100
OK.

125
00:08:59,550 --> 00:09:02,550
So what what will happen if I add Brian Brend?

126
00:09:06,070 --> 00:09:06,650
Two out.

127
00:09:08,950 --> 00:09:12,320
Five by nine, White will print, it will be my output.

128
00:09:12,790 --> 00:09:14,320
So it is actually zero point five.

129
00:09:14,350 --> 00:09:17,860
But I told you integer one integer will give me integer.

130
00:09:18,100 --> 00:09:19,330
So output will be zero.

131
00:09:21,490 --> 00:09:25,330
Now, tell me, what will Mount Board if I do see out nine by five?

132
00:09:26,920 --> 00:09:32,720
So it is when pointed, but my output will be in danger, in danger.

133
00:09:32,800 --> 00:09:37,840
But it is not getting round of output will not be to round off, is not there.

134
00:09:38,140 --> 00:09:43,420
We are just it will the revision operator will just give me the endangered part.

135
00:09:43,930 --> 00:09:44,580
So that's why.

136
00:09:44,680 --> 00:09:45,850
When is my output.

137
00:09:46,600 --> 00:09:50,650
Similarly, if I had I'd see out four by three.

138
00:09:51,700 --> 00:09:55,300
So it is one point three three three.

139
00:09:56,140 --> 00:09:57,720
So our goal will be one.

140
00:09:58,280 --> 00:10:01,510
Okay, so division operator is a little bit interesting.

141
00:10:01,720 --> 00:10:02,710
So just focus.

142
00:10:02,860 --> 00:10:08,130
So just try to concentrate and just remember, fuel will start in Dajarra one and data will be integer

143
00:10:08,410 --> 00:10:13,720
floatable and data will be flawed and indeed hereupon flawed will be flawed and so on.

144
00:10:14,800 --> 00:10:15,090
Okay.

145
00:10:16,960 --> 00:10:23,440
Now what will happen if I try and print C out nine point zero by five.

146
00:10:23,950 --> 00:10:26,350
So in this case my output will be one point eight.

147
00:10:28,340 --> 00:10:28,630
OK.

148
00:10:28,810 --> 00:10:36,010
Because Florida, born in danger, is a floating riluzole, so let's try and paint this.

149
00:10:38,960 --> 00:10:39,530
And this.

150
00:10:44,460 --> 00:10:45,730
So let's come into doubt.

151
00:10:52,130 --> 00:10:52,760
See out.

152
00:10:55,520 --> 00:10:56,330
Nine by five.

153
00:11:06,170 --> 00:11:11,410
OK, so first of all, I want to give Farenheit value, so my output is one, OK?

154
00:11:11,900 --> 00:11:13,880
So nine by five is coming out to be one.

155
00:11:14,600 --> 00:11:17,150
So let's come in and also let's come into doubt also.

156
00:11:18,350 --> 00:11:20,570
And now let's sprint CE out.

157
00:11:22,730 --> 00:11:28,460
Nine point zero sorry, nine point zero by five.

158
00:11:31,750 --> 00:11:36,130
Now, in this case, Wildwood will be one point eight.

159
00:11:38,530 --> 00:11:44,890
OK, so when branded because Florida wedding deejay is a floating you, now let's print one more thing.

160
00:11:45,190 --> 00:11:48,580
See out followed by three.

161
00:11:53,130 --> 00:11:57,120
And see out five by nine.

162
00:12:05,770 --> 00:12:11,520
So you can see here, nine by five is one, nine point zero by five is one point eight, four by three

163
00:12:11,650 --> 00:12:13,360
is actually 123.

164
00:12:13,420 --> 00:12:15,280
Burton Deja opponent Deja is in danger.

165
00:12:15,370 --> 00:12:18,940
So when it's getting Brender and my last one is zero.

166
00:12:19,990 --> 00:12:20,300
OK.

167
00:12:23,950 --> 00:12:24,430
OK guys.

168
00:12:24,460 --> 00:12:25,870
So this is it for this video.

169
00:12:25,990 --> 00:12:26,800
Thanks for watching.
