Hello and welcome.
In this video I'm going to introduce you to what executing a program means in programming to execute
or executing a program basically means getting the program to take some kind of action.
So often you hear developers or programmers using the word execute or executing or they're basically
mean is that they get in the computer or the program to do so.
Another word you may hear is run.
So executing and running a program is basically the same thing to execute the program you tell in the
computer to run or get the program to take some kind of action.
The programs can be executed in various types of environments and also in different ways.
For example if you have a bunch of code in the developer console you can execute a statement or several
statements inside the developer console so dependent on the environment you want to execute your code.
There are different ways you can do that.
I have called three complete javascript statements displayed inside the developer console to get.
For example if I wanted to get value for the third statement which is a variable add numbers if I wanted
to get the computer to compute that value and displayed there are a couple of ways I can go ahead to
execute or run the statement in order to get the desired output.
I want output basically is what the computer gives back to you.
All right.
So for this statement if I want to get an output I want the computer or the program to compute the value
here first number plus second number.
And I want it to display it in a pop up window.
Now a pop up box is something you may have come across before.
It's usually used to display different types of messages and to do that.
We use an alert function.
An alert is a built in function in javascript.
A function is basically a bunch of code that does something specific.
The purpose of an alert function is to display messages in a pop up box.
So in order to execute the statement on line 3 which is this ad number I'm going to use a alert function
which is a pop up box.
So I type in alert.
He has to be in lowercase.
And then in parentheses I need to add what I want to pop up.
OK.
So I want this variable called add numbers.
That's the code I'm trying to execute.
All right.
And I put a semicolon.
So what that would do it will add the first number which is 27 plus the second number which is forty
seven.
So it will add these two variables together and display the results in a pop up box.
Alert is a built in function in javascript that pops up messages.
So the message I wanted to pop up is this one here is this variable and this variable equals to this
variable plus that variable so five PRESENTER As you get a pop up box you can see here is displayed
the output here which is seven to force we've seen four had this plus this.
It will give me that.
So this is known as an alert pop up box.
So the output now executed this statement in an alert box I just click OK and the message will go away.
Now I can also execute the same statement in a different way.
I want 5 1 the result to display inside this console.
I will use another function which is called the console log.
So I just typing basically what the consular log means it will display the output inside the console.
So let me to the same pin do a console and in parentheses add what I want the console to display which
is the variable called add numbers.
So B console dot lock.
OK so you type P console log and inside parentheses you have to had the semicolon and then you press
enter.
You can see here the console dot log which is a function I have passed in.
I've given it the information I want to be displayed and the information I want is this variable here
called add numbers so you can see here is displayed it the output inside the console output.
Basically is the result that the program gives back.
So it's been displayed in the console.
So these are some basic examples of executing programs.
So when you hear the term executing or to execute is the same thing as running a program or to run a
program it means you get in the computer all the program to take some plan of action to display some
output.
So that's it for this video.
Thanks for watching.
Bye for now.