Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,530 --> 00:00:07,400
So welcome back, I hope you tried to solve this exercise on your own and now we are going to simply
2
00:00:07,400 --> 00:00:12,810
see how it can be done in C programming language.
3
00:00:13,430 --> 00:00:20,240
So, first of all, we are not talking about how it can be done using variables, because that's something
4
00:00:20,240 --> 00:00:25,850
that we didn't speak about in these course until now, until the next election, probably.
5
00:00:26,420 --> 00:00:30,020
So here, if you know how to use variables, that's OK.
6
00:00:30,020 --> 00:00:32,960
But that's not the point of this exercise here.
7
00:00:32,960 --> 00:00:40,910
We are simply going to use just one printing line and print the values and print the actual year of
8
00:00:40,910 --> 00:00:42,180
birth to the screen.
9
00:00:43,040 --> 00:00:46,530
So this a year of birth can be calculated very easily.
10
00:00:47,060 --> 00:00:51,470
First of all, what we need to know is what's the current year?
11
00:00:51,530 --> 00:00:57,200
So, for example, it may be, I don't know, twenty, twenty one or twenty twenty five.
12
00:00:57,200 --> 00:01:02,570
I don't know what which year you see these these exercise.
13
00:01:02,840 --> 00:01:05,740
And also what do we have to do is to know your current age.
14
00:01:05,750 --> 00:01:08,930
So if it's, for example, 20 or 30, I don't know.
15
00:01:09,710 --> 00:01:17,090
So once we know both of these values, we can calculate the year of birth just by taking current year
16
00:01:17,090 --> 00:01:19,340
and subtracting age from it.
17
00:01:20,150 --> 00:01:24,480
So let's write some code to simply print these lines.
18
00:01:24,480 --> 00:01:31,250
So print out print out the year you were born or.
19
00:01:32,100 --> 00:01:39,690
Yeah, the year you were born is and you'll hear a placeholder percentage, since we are going to use
20
00:01:40,080 --> 00:01:43,560
just integer values in this percentage.
21
00:01:43,920 --> 00:01:47,220
These should be replaced with what?
22
00:01:47,550 --> 00:01:55,530
With the current year, let's say twenty twenty one minus the age, let's say 20 semicolon at the end
23
00:01:55,860 --> 00:01:58,170
to specify that we've done with this comment.
24
00:01:59,010 --> 00:02:05,120
So instead of these percentages, we will have the calculated value out of this expression.
25
00:02:05,130 --> 00:02:11,540
So it's going to be probably be twenty twenty one point two thousand and one.
26
00:02:11,570 --> 00:02:12,550
So sorry for that.
27
00:02:12,720 --> 00:02:15,510
So the year you were born is two thousand and one.
28
00:02:15,780 --> 00:02:17,750
And if your ages, I don't know, 30.
29
00:02:18,600 --> 00:02:25,070
OK, so you simply run it once again and you will get nineteen ninety one.
30
00:02:25,890 --> 00:02:34,050
So that's a simple exercise to how you can find the year of birth based on the current year and of course
31
00:02:34,050 --> 00:02:37,570
the age either at your age or somebody else.
32
00:02:38,280 --> 00:02:39,390
So thank you guys.
33
00:02:40,260 --> 00:02:41,910
Let me know if you like this video.
34
00:02:42,210 --> 00:02:43,830
Let me know if you have any questions.
35
00:02:44,850 --> 00:02:50,700
Don't forget, of course, to leave some review to do leave some feedback so that this way I will know
36
00:02:50,700 --> 00:02:53,340
if you like the exercises or not.
37
00:02:53,700 --> 00:02:56,010
Of course, that's just the basics.
38
00:02:56,190 --> 00:03:03,780
And we are going to get much more complex exercise our exercises as we move on with this course.
39
00:03:04,020 --> 00:03:06,270
So stay tuned and I'll see you then.
3861
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.