Variables in C | C Language Tutorial | By Mr.Srinivas

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to Norwich technologies this is universe in the last session we discussed what are the main things to write a C program in our discussion so the main important things are variables and methods the reason if two programs want to communicate so what we are using is called a methods generally we can call it as a functionality or functions also and in the process of communication so what the program sharing nothing but a variables properties information we can call right so now in this session so what is a variable and what is the function how to represent variables how to declare variables right how to define functions how to represent functions all these things we'll see so first our discussion is variable what is a variable what is a variable means so generally if you want to execute a program so why we are executing the program means a processing information just processing the data take a bank application the communication is there they are executing one program to one transaction they are executing why they are executing the transaction they are processing the data account number they will process account name they will process balance they will process for every computer application we must store the information at a particular location see suppose so generally every machine having memory locations these are just considered memory locations memory locations so every memory location is identified by an address every memory location is identified by an address just consider in a classroom setting arrangement in a theatre setting arrangement is just considered memory locations every memory location is identified by an address suppose 128 fight well one zero two four five zero nine eight one zero one eight three all these are comes under addresses address we can treat like this positive in T is their value address is nothing but a positive integer value so now so what is the relation between variable and memory locations generally if you want to store some information I want to store a value ten into the memory locations which is consider in a classroom or in a theater there is no restriction on the people that where they can sit so the students entering into the classroom and no restrictions on the students so the students will go and sit randomly at different locations so by that time so ten also will go on store randomly at a particular location suppose here next I want to access the data I just want to print that information then how can we print how can we print means we face the problems reason first of all in which location it has stored that we cannot understand because a random memory location and second one if you want to open the memory no one can open the memory no one can see the information so manually physically which is stored inside the memory we know that general if you think so here accessing become very difficult after storing the information after storing the information accessing become very difficult so what we should do before storing information first we need to set identity to memory location set identity to memory location how can we set identities to locations here a syntax how to declare a variable how to declare a variable means in the syntax first we have to write the data type followed by so what is the variable name the name we have to write this we can call it as identifier so one example datatypes briefly we'll discuss in the coming concepts here it is integer as of now we know integer is a datatype and variable name you can set any name for example a here a is identity so whenever you declare a variable then it gets memory allocation to one memory location that identifier will set a J is a named memory location to the memory location we are providing a name so later whenever we are storing the element we are strictly saying you please go and store into a location which is identified by a here it is so value is a 10 and we are saying that you please go and sit into the location which is identified by now restrictions on the students for example energy eaters and is the seating arrangement they will reserved one particular seat for us so then the strict rule is that you please go and sit somewhere on that particular seat which is allocated to you so later if they want to access easily they can access sir if more number of seats they will announce in the Mike simple identification become very very easy so here so a is equals to 10 means the 10 will go on store into this location later if you want to access whatever the operations you perform I just want to print it in simply you can print a then it will go on search what is the value which has stored inside the memory location a so that is a 10 so it will print the output is a 10 okay so simply what is the variable finally named memory location name memory named memory location is called variable right setting identities to memory locations by which we can process the information effectively that is what we call the variables and next we will see what is the method nothing but what is the function so now the discussion of what is the function simple definition so what is a function syntax directly observe clearly block of instructions here you can write n number of instructions and it is a block block of instructions having identity name mandatory having identity it is taking input every function technically so we can call it as arguments list generally we can say it is an input which is taking input and processing that input this is a processing logic is a processing input and finally it should produce the output output technically we can call it as a written type generally so we can say it is output function is nothing but block of instructions having identity identity is mandatory having identity which is taking input processing the input and producing the output if you see example then you will get more clarity just consider block of instructions this function is add function I want to perform addition operation add function if you want to perform addition operation so what is the minimum input you have to pass the minimum input to integers for example take a calculator I want to perform addition operation minimum two numbers you have to press or else it is not possible to perform addition operation so here two two numbers we are collecting into two variables just now we discussed variables int X and int Y suppose if you type a 10 and 20 the 10 will go on store into X and the 20 will go on store into y and next the processing logic into Z equals to X plus y we are adding x and y and the result we are storing into Z after processing the information we are returning that value written Z Z is of type what integer type Z is a integer type so return type is a integer block of instructions having identity addition right function means what it is doing one task the marker is functioning means what it is doing something what it is doing it is writing mobile is functioning means what so many functionalities are there methods are there we are calling we can message we can browse play videos games and all if the person is functioning means what I am functioning means what I am teaching I am speaking right I am watching I am reading I am walking right all these are comes under functionalities so here it is a what is the function means it will perform a particular task so here it is the add function is performing the task so what task it is performance or addition operation is taking input two numbers it is adding and it is returning the result that is it this is what we call a function simply so finally the definition so what is the function block of instructions block of instructions having identity which is taking input comma processing the input and producing the output is the function definition and see here one more thing we have to add to the function is only if you are writing definitions of function no use the important thing is right in every program in every program along with a function definition one more thing is also important along with a function definition function call also important function call only definition you are writing no use for example calculator right so they already defined one functionality addition functionality plus button they are given in the entire lifetime of that calculator no one is using that identity nothing but no one is using that button plus then what is the use of that if object is there nothing but if one physical thing is there and it is having a functionality means right everyone should use that functionality at least once in its lifetime so simply we can understand what is the functionality means just consider one electronic device best example television in our daily life we are using is an electronic device so in the background so one program is there it is running with the help of program so motherboard should basic storage capacity means what storage devices and everything will be present they already written one program how they will write means to on the television one functionality is required it is power on and next to off so generally we are using these things of logic is there and next one for example if you want to change the channel functionality is there and mostly one more thing we are using everyday is a volume volume a functionality they have given logic already they have written but see only functionality is there no use if you just look at the TV will it start automatically impossible right will it change the channels automatically know along with the functionality along with the definitions of functions calling is also very very important another person nothing but another program suppose take one person take one person the person is using the remote control this is a remote controller it is also programmed and the person is also programmed and a television is also programmed and here it is they have to call the functions one is a on function of function and here disease and early channels they will give like this they will do for example channel + + channel - - volume + + volume - - is a remote controller so another program should call the functionality of television from another place so whenever they click on on function so then the corresponding logic executes then the complete set of instructions execute and the system will on and whenever they click on that off then automatically of functionality executes so not only definition is important - functions along with the function calling is also important just consider somewhere one mobile is there if you want to access the mobile from another place someone should call the mobile is calling right so here also function calling is important I know see but someone should ask you please teach see so then only there is a use of my C knowledge someone should call so whenever they call so then I will start explaining the C language so this is what we called executing the functionality if not executing this functionality see language I am NOT teaching suppose I have the knowledge and I am NOT teaching to anyone what is the use no use so function definition is important function call is also important because from the first C program we start working with the functions that I will show you clearly okay so thank you for watching thank you
Info
Channel: Naresh i Technologies
Views: 1,175,948
Rating: 4.8978195 out of 5
Keywords: C Language, C Variables, Srinivas, Naresh IT, Hands on C Language Training, Online C Language Training, C Language Tutorial Videos, C Language Interview Questions, C Language Tutorial, Variables, variables in c, variables in c language, what is variable, need of variable, static variable c, variable in c programming, c srinivas, srinivas naresh it
Id: rFnWoTnoC50
Channel Id: undefined
Length: 16min 18sec (978 seconds)
Published: Sat Aug 27 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.