Hello, everyone, and welcome back to the cause.
So I hope all of you got to play with a little bit of C++.
We have not done anything special in our last program.
We just made a program that was printing something out to the user.
So today in this video, we just do a very small problem.
We will try to do something a little more interesting than what we did last time.
But again, very, very simple problem.
So what do you want to do is we want to take two numbers, add them up and give it out to the user.
OK.
So nothing special.
We will simply take two numbers, add them and we'll give our producer.
That's it.
OK.
Let's get started on that.
OK, so first of all, let us create a new file file, new and then empty file.
Save file.
Add to a number.
And then dart CBP.
Si.
Okay, so let us write some code.
Hash included.
I will stream
using using namespace SDD semicolon
and main.
And then I'm having it done zero.
OK.
So just a second.
OK, so let's say my first number is 10, so I equals then and my second number is 15.
So G equals fifteen.
Don't forget to write him a column.
So basically, what do you want here?
I want the system to give me some memory in which I can store my data.
So first of all, I will get some memory.
I will store some detail in it.
And after some time, I will have to assess the data.
So we call this storage, this data variables.
So what do we want?
We basically need some space.
We want the system to give us some space.
We want to name it something.
And we want to put some data inside it.
Why do we want to name it?
We want to name it so that later on when I want to assess the data, I have a way to do that.
Okay, so let's see.
Blandon.
OK, so there is an added.
And we can read their statement here.
I was not declared in this court.
This basically means my compiler doesn't know what is a.
OK, so why this ad is coming and how we can resolve it.
OK, see if I want to store some data in my brain.
I have to do nothing special.
I just need to say, hey, please do then.
And it will restore somewhere in my brain.
Similarly, a store fifteen, and it'll be stored somewhere.
But to store data in a computer winterlude, something extra.
OK, so let's see what extra work we have to do.
So for storing retain our computer, we have to tell two more things.
What do you want to store and how much space you want fostering or draw down and this problem?
I want to store in deejay's.
And now I have to tell one more thing, how big and tedious you understood.
Do we want to store hundred or let's say a thousand?
So these are very small numbers.
OK.
So under 10000 are these poll numbers.
They require very less space.
But what if if you want to store a big number, for example, one, two, three, four, five, six,
seven, eight, nine, one one, one, two, three, four.
So this is a very big number and it requires a lot of space.
So we have to tell our system how much space we want.
We want to buy it all we want for bite it, bite 16 bites.
OK.
So we have to two things.
What do they want to store and how much space you want for storing your data?
So in this case, I want to stay in business and I want to store decent size integers, my integers
will not be too large and it will not be too small.
OK, so we need to right here.
And.
And similarly.
Indigene.
So in Dimmeys, indigent.
And in desert data type our first due to diapers.
And so I did a tape tells us two things what data you are storing and how much space you want for storing
that data.
So in this problem, I want to store in Tejas.
And my teachers will be of four bytes.
But how big in pages begins drawing for Bite's?
We will discuss it in upcoming we do's.
OK, so let's solve this problem.
So I need one more variable, let's say the name of the variable is key.
And what is there a low key?
I plus G.
I bless G.
And then what will I do?
I will bring Turkey because my answer is invariable.
So we'll see our turkey and then semicolon.
OK.
So virtually my answer.
My answer should be 25.
So, Ballenden.
And my answer is twenty five.
OK.
OK, so what if I want to change my life, if I.
So we can easily do that?
I will simply write I.
It calls Hardeen.
For example, the new radio of I is putting.
There is no need of writing intention.
OK, so what is happening?
My aim was to change the value of I, so I will simply write.
I was 13.
There is no need of writing in indigene.
And what is happening here?
I have my memory for bite's.
The name of this memories, eh?
And here I am having an.
OK, so what this state run will do?
It was simply right, Hardeen here.
OK.
There's no need of writing in again, because we don't want to create a separate memory.
We just want to write to.
OK.
Similarly, you can write like this.
J.
Question.
So the new LFG will be done.
OK.
So you can change the value of any variable at any time.
And there is no need of writing in Dugin.
OK, so let us all.
And then interesting problem.
Suppose I want to calculate simple interest.
Simple interest calculator.
Nazi BP.
Hash include ice cream using namespace SDD
and demesne, and then I'm having it done Zettl.
OK, so I want to keep it simple interest.
OK, so what is the form love?
Simple interest.
Simple interest equals principle multiplied it multiplied time wholly divided by hundred.
Okay, so I need four variables here.
And B, B for principal LEMSIP.
Let's leave.
Principle is handed and then semicolon.
And ah, let's say 10.
Entity time.
Let's say five years.
And end simple interest it principal multiplied eight multiplied.
Time divided, way handed and then semicolon.
So after calculating simple interest, what will I do?
I will bring simple interest.
So see old.
Simple interest.
Okay, so let's say it, Cornford.
And B hundred.
And greed equals then an end time equals.
Suppose five years.
And simple interest.
It.
Principle, multiply it eight multiplied time and then wholly divided by hundred.
And then some column after concluding simple interest, see out simple interest.
Okay, so virtually my output.
Let's see.
So simple industry equals.
And dirty and 210 and five divided by hundred.
So my eyes should be 50.
OK, so let's wait and then.
Ballenden.
So my answer is fifteen, which is hundred percent correct.
OK, so that is all for this video.
Thanks for watching.