Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
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.