 Hello friends, I am Sanjay Gupta. Welcome on Sanjay Gupta Tech School. So, C language video series, this is lecture number 32 which is after completing the entire video series, I am making some important topics to revise. So basically this is for engineering students. If you are an engineering student and you have completed B Tech or you are in third or fourth year and you want to prepare for your placement then after watching the video series, you will get an idea of the whole C language but we want to do a quick recap. If we are asked questions about what is the operator, what is the data type, what is the call by value, what is the call by address. So we should know its brief answers. So to fulfill that requirement or if you are a first year student and you want to prepare for Viva then I am making this video by watching all the requirements. So in this, Viva voice preparation will take place. If you are preparing for a campus placement interview in which you want to prepare C language then you can watch this video and if you want to revise your knowledge normally we study C in B Tech in first year and campus interviews are in third or fourth year. So we have to revise our knowledge for once. So if you have seen individual lectures then you will get to know about this topic but you want me to get a brief introduction of each topic in one video. So for that I am preparing this. After watching the video, if you have any doubt or questions raised then you can communicate with me in detail. So let's start. So now you will see to the point that what is address of operator. So you should know that this operator tells the memory address of any particular variable. So you have told that where can we use this. So you must have seen that whenever we use any variable in scanf then we use m% sign which is mentioned here which is address of operator. So whenever you want to scan a value you have to use this operator. So it tells the variable address. When you use pointer in pointer then we use operator to store any variable in pointer. So if you will give an example with definition then you will get a good impact in Viva or operator use. Then next comes adding. So now I have prepared the answers of these questions. The heading you will see is alphabetical. So randomly you will get topics in front of you which we will discuss. So an array is a group of related data items that share a common name. Array is basically a user defined data type that is used to hold several variables of same data type. So if we don't want to create many variables we want to store many values of the same type. We can use the same data type for that. Then all the members of an array are stored in consecutive memory locations so continuously allocate the memory. Then last point says the number of variables which an array can hold is size of the array. For which we use square bracket. So the value mentioned in square bracket tells the size of the array. And three types of array are 1d array, 2d array and 3d array. Next comes associativity. So the operators of the same precedence. Now precedence means priority of operator. So when we reach the p-alphabet then precedence will come. I will explain it now. Precedence means order of evaluation of operators. Sometimes your expression or calculation has two operators. Same precedence which has the same order. So either we evaluate them left to right or right to left. There are two things mentioned here. Left to right or right to left. Depending on the level. This is known as associativity property of an operator. So for associativity and precedence of an operator you can search the net for precedence table of C. So there you can see the rank of each operator and its associativity. Then binary files. We saw this in handling. Contains are stored as 1 and 0. It occupies very less space. It is very difficult to view and modify binary files. So we can only retrieve and store it through the code. If we open the file normally then you will find anything readable. Then binary operators are those which use two operands in an expression. So if we talk about an example, I will write C equals to A plus B. So here plus is an operator. And it has two operands A and B. So the plus we are using, can we operate without two variables if we have to perform an addition? No. It means plus has two operands requirement. So operators which have two operands requirement they are binary operators. Then break. It is a keyword. So we often come across the situation where we want to jump out of a loop instantly without waiting to get back to the conditional test. The keyword break allows us to do so. So whenever you have to terminate the break or we talk about the switch statement, we use the break in the switch. If we just want to execute a particular case, you can use the break there as well. Then what is C programming language? So it is very important as C is a programming language. Often just C is a general purpose procedural programming language developed in early 1970s by Dennis Achie. So these are the basic things which you should know. Then call by address. I explained this in function. So when we pass a variable in another function, we want that the second function if there is a change in it, the first function should reflect that change. So for that we don't pass the variable's value and pass their addresses. That is why we call it call by address. So in this mechanism, the address of the actual arguments are passed to the function. Therefore if any change occurs in the values of formal arguments, that change also gets deflected from the actual arguments. Call by address is a complicit using pointer. So there are two things here. Actual arguments and the second is formal. So actual arguments will be available from where the function will be called. And formal arguments will be available from where the called function will be defined. So if there is a change in the called function in the formal argument, then that change also gets deflected from the call by address. Because call by address we use pointers. Then next comes call by value. So what happens in call by value? In this mechanism, the parameters are passed directly. That is we pass the value of the variable to the called function. If we change the value of the formal argument, then again where the formal arguments will be available? The function we called in its definition. No change occurs in the actual argument. So the actual arguments are called through the function. The second function is called. So there are two functions here. The first one is called and the second one is called. So the actual arguments are called and the formal arguments are called. So in the case of call by value, if you change the formal argument, then the actual arguments do not change. This is because the copies of the actual arguments are passed to the formal argument. So here there is no relation in the actual or formal argument. So when there is no relation in the two variables, then both the memories are separated. So if we change them in one, then there is no reflection on the other. That is only when you create a pointless relation. Next comes case sensitivity. So this is very simple. Case sensitive is a term in which lower case and uppercase characters are treated differently. So if you write small a and capital a, then both the meanings are different. So as we make the password of our email id, passwords are case sensitive. The uppercase that is written in the upper case is written in the lower case. So the same approach follows the C language. So you have to take care of the uppercase and lower case in C because it is case sensitive. Then conditional operator. So we use two symbols. The first question mark and the second colon. So conditional operator, question mark and colon are sometimes called ternary operator. Since they take three arguments. So two operator, so we have to use three parameters. This operator works similar to conditional statement that is fls. So normally sometimes we don't use fls. We want to check the conditions in one line. To recognize its true and false part. So for that you can use this conditional operator. Constant. So a constant is a quantity that doesn't change during execution of the program. This quantity can be stored at a location in the memory of the computer. So we store the constant and where it is stored we call variables. For example if you write int a equals to 5, then there will be 5 constant and a will be variable in which we store that value. So in C programming there are four types of constant. Inteser, float, character and string. So you can directly use these four types of constants and you can store them in the variable. Now next one is continue keyword. So in some conditions we want to take the control to the beginning of the loop by passing the statements inside the loop which have not yet been executed. The keyword continue allows us to do so. So for example you have written a for loop, a while loop, a do-while loop and inside the loop there is a particular statement. You want that after that statement not to be executed and the loop will skip one rotation. So for that we use continue keyword. So the break terminates the loop but the continue loop will skip one rotation when it will occur and the after that rotation will be executed normally. Then data types. So data types are used to identify the type of data which we want to store in variables. So in our programs there will be a lot of data types like int, float, character, double, long, void. So all these are data types which you want to store the type of value to create that type are available to you. Now debugging. So to correct a problem in hardware or software debugging the software means locating the error in the source code. The program logic which you implement. Debugging hardware means finding errors in the circuit design logical circuits or in the physical interconnections of the circuits. So debugging means identifying the problem and if you want to resolve it then bug means an error. So debugging identifies that error and resolves it. So many times you might have heard that there is a question in the code and you want to debug it. Can you debug this code? So you have heard such terms. Dynamic memory allocation. So the process of allocating memory at runtime is known as dynamic memory allocation. So according to the user requirement if you want to allocate memory then we use dynamic memory for runtime and if you want to use programmer according memory then we use static memory allocation. So I have explained this properly in a video. So in this video series then executable code So software in a form that can be run in the computer it typically refers to machine language which comprised of native instructions the computer carries out in hardware. So such code which you can execute so you must have seen whenever we run the program then it is compiled then we click on the execute button. So when it is compiled then it becomes a binary file when we execute then the object code is converted to executable code which is finally run. Now file So in file handling we used this term file. So file is basically a collection of data. In C a file is considered as a sequence of bytes where each byte has a unique address. Any address of byte is known as its offset. The position of a file pointer from where the read and write operation will be performed. So if you have seen the video of file handling then you must have seen that we have used the file pointer using the capital file. So it tells us which position we have to perform the current position of the file pointer is called current offset. So basically these files we use to process the file handling and normally you can store your C file then format specifier whenever you have to perform the reading and printing operation through print tab or skydive So for int we use %d for integer type variable for float type variable for character type variables Now function So function is a set of control block of code that performs a particular task So in the function video we told you that we can make more functions which is a user defined function and there are some predefined functions which we can directly use So basically function is a set of control block of code that performs a particular task So once a function has been defined and packed it can be treated as a block box that takes some data from the main program So it will receive some input it will perform some calculation and it will provide you with a result So it can be done in such a way that it will return the result and it can be done in such a way that it will print the result directly and not return it So for that it depends on whether you use return type int or void use type Next is getCH So those who have used TurboC compiler for programming can read the character from console but it doesn't echo that character So key press will read it but it is not visible on the screen that what character you have pressed get care it is also a predefined library function which is used to read a character from console but it terminates by slash n meaning after key press it will have to press enter it echoes the character entered by the user So the key you press and getCH it also reads a character from console and the key which you press will echo So what is the difference between the three getCH, key press read it not to display it, not to press enter get care, key press you can see key press and you have to press enter and it will read it getCH key press will be visible after that it will not press enter as soon as you press key it will automatically read it Now hardware is very simple in operation a computer is both hardware and software one is useless without the other the hardware design specifies the commands it can follow and the instruction tell it what to do header file is very important in every program So these are the files which contains declaration of the predefined function like in printf scanf we used stdio.h sqrt pow mat.h exit so there are many such header files which are made for different predefined functions so you can use them then if else conditional statements are there so it allows the computer to evaluate the expression first and then depending on whether the value of expression or condition is true or non-zero or false-zero it transfers the control to a particular statement so if it is true the statements that are written with if if it is false the statements that are written with else will execute the point of program has two paths to follow one for the true condition and the other for the false condition then comes index of array so index of array is used to store and retrieve any particular value in or from the array it starts from 0 and ends to n-1 so whatever array program you have made it will start from 0 to n or less than equals to n-1 or less than equals to n-1 and basically index is when we make an array the name of the array remains the same but there are many locations so we use index to identify different locations from the same name then instruction so a C instructions in C instructions are the statements which tells the computer to perform the specific task so as you have written printf you have added you have done multiplication you have written scanf all these are statements so if you combine them it becomes a program keyword is very important so keywords are the words whose meaning has already been explained to the C compiler or in a broad sense to the computer the keywords cannot be used as variable names because if we do so we are trying to assign a new meaning to the keyword which is not allowed and the keywords are also called reserve words library functions so library functions are called pre-defined functions like we use printf scanf, getch these all are library functions which whose definition have already defined in system library which we include before we write our main function so these functions whose code is already written the compiler already knows you just have to call the function and use a header file so these functions are called library functions then comes loop for solving variable size problems programs need to execute some set of instructions many times to determine the result so this process of repeating the same sequence of steps is referred to as iteration or loop so if you do not have to write the same task then you can automatically loop it there are three types of loops for loop, by loop and do by loop which you can use then comes main function so main is a user defined function that is must for every program so you will not have to write any program so main is must and you can make a function but you cannot ignore the main function because without main function any program cannot execute then comes object code so whenever we compile the program object code is created by a compiler and is then turned into executable code by the linker then comes operator so an operator is a symbol that tells the computer to perform certain mathematical or logical manipulations operators are used in programs to manipulate data and variables so for example you use plus, minus, multiply less than, greater than, equals to so all these are operators so basically three types of operator are unary, binary and ternary unary is the one who has one operand requirement binary is the one who has two operand requirements so operand means variable or constant then pointer so pointers are the variables which are used to hold address of the variable so if you want to store any variable then you will use pointer since the addresses are always whole numbers therefore pointers always contains whole numbers we can have an integer pointer or float pointer or character pointer etc so the type of variable that type of pointer you have the permission to make you can use it I have already explained the precedence let's see again each operator in C has a precedence associated with it this precedence is used to determine how expression involving more than one operator is evaluated there are distinct level of precedence and an operator may belong to these levels the operators at the higher level of precedence are evaluated first so you can understand precedence means rank of operator the rank of the operator is first evaluated whose low rank is given pre-processor so pre-processing is the first step in the C program compilation stage after pre-processor expansion an intermediate code is received by the compiler so you have used hash define so whenever you compile the program they perform their tasks they replace themselves wherever they require those codes the program is very simple a collection of instruction that tells the computer what to do a program is generally known as a software and the programs users work with such as word processors spread sheet are called applications or application programs thus the term software application program and instructions are synonymous in the sense that they all tell the computer what to do there is a program in the small sense there is an application in the big sense there is software in the bigger sense so we use interchangeably in terms of terms then comes recursion there is a process where a function calls itself so if a function calls itself then it comes with a recursive process return type so whenever you make a function there is a return type of function which tells what type of value will be returned by a function when it is called so it can be int, float, care, void anything can happen size of array whenever you create an array the square bracket plays two roles sometimes it tells size and sometimes index so if you use the square bracket with data type it will always tell size and if you use the square bracket without data type it will always tell index software is a collection of program which tells the hardware how to process data the two major categories of software are system software and application software then comes storage classes so to fully define a variable one need to maintain not only its type but also its storage class in other words not only do all variables have a data type they also have a storage class so whatever variable you make there is a storage class associated so total four storage classes automatic registers static and external so you can use them as per the environment string the way a group of integers can be stored similarly a group of characters can be stored in a character array character array are many times also called strings so string has a special property that in its end the null character automatically inserts so we can identify the total number of characters structure is a constructed data type which is used to store elements of different types together under a single name so you can ask what is the difference between an array and a structure so in an array we store similar values whereas in a structure we store different types of values now comes switch so the control statement which allows us to make a decision from the number of choices is called a switch or more correctly a switch case default there are three keywords switch case and default since these three keywords go together to make up the control statement so in many options when you have to select an option what we will use for that is switch statement then comes syntax so syntaxes are basically rules so the rules governing the structure of a language statement it specifies how words and symbols are put together to form a phrase so you must have heard that if we use loop we should know its syntax how to write it how to write it how to write it so every thing has a proper way that is known as syntax in programming language so any programming language when you learn it it is very important to know its syntax syntax error if you haven't implemented syntax properly then you get syntax errors on compilation time so you have to resolve the syntax errors only then your program will be successfully compiled text files so contents are stored as characters text file could be created by a text editor it occupies more space in memory it can be easily viewed and modified so I have added the file handling video in this playlist in that text file and binary file both are used so you can analyze the difference by watching that video ternary operator we have already discussed as a conditional operator so we use 2 symbols question mark and colon its syntax there will be 3 arguments expression 1 then expression 2 then expression 3 so there are 3 operands expression 1, expression 2, expression 3 and 2 operators that is why it is known as ternary operator expression 1 tells the condition expression 2 true part expression 3 false part type def so type def is a keyword which is used to create a clone of data type so as you use int and you want if I can create a variable with integer words so you can give the power of int to the integer word similarly you can use character for care so type def basically is a data type property so you can create a clone of the data type ternary operator ternary operators are those which takes only one operator and one operand to create an expression so you have used plus plus or minus minus so these are examples of ternary operators union each member has its own stories as a structure whereas all the members of union use the same location so union the memory location is shared by all the members whereas in the structure each member gets different memory this implies that although a union may contain many members of different types it can handle only one member at a time so your requirement is that you have to declare many variables but you have to use only one at a time so that memory can be saved so you can create a union so these are the other functions so these are those whose definitions are defined by the user itself and it can be called in the main function main is also a user defined function then value at address which we used in pointer so here we use it asterisk which is used to identify the value of the variable so this operator is used in pointer arithmetic to retrieve value stored at a particular address variable or variable is a data name that may be used to store a data value unlike constants that remain unchanged during the execution of a program a variable may take different values at different times during execution so that's all so these are some important points that I discussed in this video related to your preparation for viva or campus placement interviews so these are basic things but you need to know all these things while you are giving any viva or you are sitting in the interview and remember that these points are all basic don't understand that you have worked for 4-5 years in industry and after that you are watching this video and you have to use this so this won't be helpful but you are beginners initially you want to prepare for viva so this video will be helpful and if you have any doubt if you want to discuss with me then these are my details and if you want to see the entire video series if you have only seen the interview questions but if you want me to read every topic in detail then you will get the playlist link so you can follow the entire video series and I hope that the questions I have explained in my video will be helpful for your preparation so thank you for watching this video