 Hello everyone, today we are going to discuss on the topic basics of Kotlin programming language. Let us see learning outcome of this topic. At the end of this session, students will be able to describe variables, data types, functions of Kotlin programming language. Before going to this variable declaration, we have seen in the last slide that what is the Kotlin and where it is used and what purpose it is used. Kotlin is a programming language which is used for development of Android applications. And in the Kotlin, we have seen there are a number of data classes, there are a number of boilerplate generations and there are a number of strings and everything is involved in the Kotlin programming language where the developer can use those languages or those components for app development. Now after that, we are going to see the variable declaration. In Kotlin programming language, the variable is declared using two keywords namely as well and where. It is a short form of well, value and where. There are two types of variable. So what is the use of where and what is the use of where. So well is used for variable whose value never changes and it is cannot reassign the value. Where is used for variable whose value can change and we can reassign this value to any other part of the program. The user or programmer can use as per the requirement these two types of variable value. Where the value of variable is going to change then in that case user or programmer can use where and where the value is constant in that case the user can use where. So for these two syntaxes keyword variable name data type equal to value. Actually the syntax of Kotlin variable declaration is totally different than and Java. So here we have to write the keyword variable name that is variable name is a good identifier name and we have to write the first type and then which value we are going to assign to that variable that is value. Now let us see one core snippet for keyword well declaration. So well number well is the keyword number is my variable name data type is integer and 10 is the value which is assigned to the number of type integer which is a well. So here I am writing a function main and only I am printing the number. So for printing we are using a print ln the number and the number which we are going to store in that variable it is displayed. So in the right hand side the output is showing that value of 10 is displayed. Now we see the variable declaration using well previously we have seen well and again we have taken the value of well number integer 10. Here the value we are already assigned to a number variable is 10 and in the function main I am changing the value again number equal to 20. Previously we assigned the value 10 as of type integer to the number variable. Now in the main function I am going to change again this value 20 of the same variable as a number. But in this case Kotlin will give error because as we have seen the definition when we use a well keyword then we cannot change the value of that variable. So if I write print ln number then it will generate an error. Now we will see the variable declaration using where keyword. Here the same code we are writing but only the keyword is where where number integer equal to 10. So here 10 is assigned to the number variable of type integer. In the function main I will print number print ln number. So in the output it is showing that is a 10. Again the same value I am going to assign to the number variable using where keyword and in the function main I am going to change this value to the number that is 20. Now in this case the printer number will be displayed as a 20. Now here where will allow you can modify the value but well cannot modify the value. Remember this is a difference. Type inference type inference is one of the important component in the Kotlin programming language. What it does exactly it automatically detect the data type of the variable during the compilation time. This is a very good feature which are embedded in the Kotlin programming language. So type is defined after variable name. So here again we use keyword where title and give the string. So if I write the variable string so it will automatically detect the data type of the string and it will assign that value to the string. So here we see the example. In the function main I have declared type inference variable name string equal to tanu. I already declared name tanu to string variable name of type string but again I am assigning a different value to the same variable that is 12 to the name. In this case if I type println name then Kotlin will generate an error because once you assign a value to the variable you cannot reassign a different type for the same variable. This is one of the feature of type inference. Next we use conditional statements in Kotlin programming language. So conditional statements are the statements where if the condition is true then the statements following that construct will be executed otherwise else part will be executed. In the Kotlin programming language if I declare number variable as var which is of type integer and assigning the value tan in function main I am comparing the value which is the given value. So if num equal equal to tan then num equal to num plus tan means the value of num is same then it will add the value of num into the tan value and then it will print the new num value on the output. If it is not else then it will display only the previous num value that is a tan. So in this case the output will be 20 because first condition if num equal equal to tan is checked it is true then following if following statements will be executed that is num equal to num plus tan that is num value tan tan plus tan 20 so it will print number as a 20. Here another example where num integer equal to 30 in the function main if num equal equal to tan num equal to num plus tan print num else if num greater than equal to tan again in the else if we are going to check whether the entered number is greater than or equal to tan. If it is there then it will add that num value do plus 20 and print the number as if num is greater than equal to 20 then num equal to num plus 30 print only num as print num. So here we are assigning two values first one is num equal to integral to 30 num equal to 10 then num equal to 20 like in this way. So in the first if construct if num equal to 10 it will num plus tan it will display 20 else if num value is greater than 10 then it will add that value plus 20 and display the num value as if num is greater than equal to 20 then it will add num value to 30 and print the num value otherwise if any of these numbers are not exist then it will print only the num value functions. In the functions Kotlin supports some block of organizer statements to execute the code. Here a block of organizer and reusable code that is used to perform a single task in this case we are using fun keyword for declaring a function we are using a fun. So fun then you write the function name open close bracket colon and then data type and followed that open curly bracket then statement one statement two statement return function name in this case first we define function name of type fun then we declare data type then we write the all the statements and at the end the statement which are returning the function name and close the curly bracket. Consider an example here we want to add two numbers using function. So here I write function add two numbers so add underscore two underscore number is my function name of type integer again after open curly bracket I write the statement val num one is a val of type integer which contains 10 value num two is val of type integer which contains 20 value num three is a val of type integer equal to num one plus num two then it will return num three in function mean I will print print ln add two numbers. So in the function mean I will call the function which is we defined above so in the function mean I will add underscore two underscore numbers open close bracket this is a calling function which call above code and execute the code. So the answer is 20 plus 10 30 so num three will return 30 value to the function mean okay now we will see the question question is set the difference between val and where answer is val which is the short form of value is a constant and it cannot be changed once assigned and where which is a short form of variable is a storage location that accepts the reassignment of values that have the same data types again we will see one more question what is the entry point to a Kotlin program answer is main function is the entry point to a Kotlin program these are the references for this topic thank you.