All language subtitles for 4. Variables Code Example 1 2

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

So before we move on, I want to show you guys how using your input will look like in real code and

how you're going to actually use the console application to reading books from the user.

And the first example I want to give you is a simple program that reads a number from the user and then

prints that number on the screen.

So for that, let's first of all, create or declare a new variable.

Let's call it Nalmefene Nahm.

So here we just created a variable called Nahm.

Its name is now.

And this of tight.

And of type end.

All right.

And now, just for the explanation, let's assign some value to NUM.

For example, let's call it naoum equals to 10.

All right.

And before we actually use inputs to read the data from the user, we'll just use the assignment just

to show you.

It will be much easier for me to explain to you guys.

And now I want to print this name on the screen.

So for that, I'm going to use print Taffe and just print narm.

Is percentage the ampersand can and just replace the percentage with the nom itself.

Right.

Semicolon at the end.

We'll save it.

And now if we are to run this program, let's build and run it.

You can see right here in the console application Nahm is found.

All right.

We'll learn of it so far.

That print half prints, some message, some text to the screen, to the console application in our

example.

So NARM is ten.

Great.

So now if we run this program once again, let's run it once again.

We can see that the result is going to be the same.

And if we run it once again, the result is also always going to be Nahm is standing in such a case.

All right.

Even if you run it a hundred times or give the program to different users, you will still get the same

result.

And the reason is that you assign their value to narm insert a free hardcoded manner Naam equals to

ten.

So now we will not assign a value of ten, but rather we are going to give the user the ability to insert

the value on itself.

And you can do that by first of all, removing the base assignment.

OK.

Now he's not equals to ten to ten anymore and we'll just use the scanner function.

So scan F exactly as we've seen in the previous video.

The percentage D because we are reading an integer.

Right.

And we are going to put it inside of numbers.

All right.

The ampersand specifies the address where these variable nahm resides.

Now if we build and run it, we can see these kind of prong to these console application that expects

you to insert some value.

So let's just insert let's make it five or.

All right.

And once you hit the enter button, the value itself you've just specified is going to be inserted in

this variable num.

Right.

It's going to read it from this console application, from this prompt and just put it inside of this

num variable.

So press enter.

And there you go.

You can see the message num is five, Nahmias five printed out on the screen.

So now if you try to round this program once again.

Let's do it once again.

Run.

And just insert here.

I don't know.

A hundred.

All right.

So the result is going to be different than the previous one.

So now we will get this one hundred once we press the enter button.

We will get this one hundred inside of this num variable.

And then we are going to see Naoum is a hundred.

So let's check this out.

Press enter.

And there you go.

You can see NUM is a hundred.

And that's how you use variables and how you use inputs in C programming language.

This simply means that we created a more generic program.

They're different.

Users may use it and insert different values and we'll see in the next examples.

Why is it so useful as well as not only in the next examples?

We will see it also during the whole course.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.