1 00:00:14,300 --> 00:00:20,750 Hello and welcome to the golden programming language course in the previous session, you talked about 2 00:00:20,750 --> 00:00:22,190 arithmetic operators. 3 00:00:22,580 --> 00:00:27,020 And in this session, we want to talk about the other operators concept. 4 00:00:31,840 --> 00:00:39,490 Assignment operators, assignment operators are used to assigning a value to a variable. 5 00:00:40,300 --> 00:00:47,650 The left side or brand of the assignment operator is a variable and right site or plan of the assignment 6 00:00:47,650 --> 00:00:48,970 operator is the value. 7 00:00:50,320 --> 00:00:56,230 The value on the right side must be of the same data type of the variable on the left side. 8 00:00:56,650 --> 00:01:05,680 Otherwise, the compiler will raise an array of assignment operators and go languages are simple assignment 9 00:01:05,680 --> 00:01:09,020 operator, add and assignment operator. 10 00:01:09,600 --> 00:01:12,100 Subtract and assignment operator. 11 00:01:12,370 --> 00:01:14,790 Multiply and assignment operator. 12 00:01:15,280 --> 00:01:17,440 Divide and assignment operator. 13 00:01:17,650 --> 00:01:20,170 And Modulus and assignment operator. 14 00:01:20,860 --> 00:01:26,650 Now let's go to your school program to illustrate how to use of assignment operators. 15 00:01:29,980 --> 00:01:33,290 First, we define two variables and initialize them. 16 00:01:33,310 --> 00:01:46,760 For example, that a Boyda type eight equals 30 and Vice B by the time gained and equals 15. 17 00:01:49,060 --> 00:01:52,780 Now create the Sampat for simple assignment operator. 18 00:01:53,170 --> 00:01:57,970 Now we will write a equals b. 19 00:01:59,490 --> 00:01:59,940 OK. 20 00:02:00,000 --> 00:02:04,050 A variable value is equivalent be variable value. 21 00:02:04,260 --> 00:02:14,250 Now go to the next line and disbelief values are variable A and B, so the right f be a equals, said 22 00:02:14,250 --> 00:02:14,790 Avery. 23 00:02:14,790 --> 00:02:26,580 Then I go to the next line FP B equals comma B, so reformat the code, save the project and execute 24 00:02:26,580 --> 00:02:27,300 the program. 25 00:02:27,570 --> 00:02:29,550 Go wrong dot. 26 00:02:29,860 --> 00:02:31,630 This list may just go. 27 00:02:33,570 --> 00:02:36,900 Now we can see the output A equals one. 28 00:02:37,620 --> 00:02:43,380 B equals 50, so a variable value is equivalent B variable value. 29 00:02:44,550 --> 00:02:48,540 Now create the same pin for add and assignment operator. 30 00:02:48,930 --> 00:02:50,850 So first, clear the last code. 31 00:02:52,410 --> 00:02:56,280 So we write a plus equals B. 32 00:02:58,080 --> 00:03:03,270 It adds right or end to the left or print and assign a result to left or print. 33 00:03:03,420 --> 00:03:06,690 It means a equals a plus b. 34 00:03:07,110 --> 00:03:15,450 Now we display the value of a variable, so we write FP A equals a. 35 00:03:17,350 --> 00:03:24,310 Save the project and execute the program first, clear screen, go run, dot back as main the school. 36 00:03:27,290 --> 00:03:36,530 Now we can see the output, a variable value is equivalent, the sum of variable A and B, and it is 37 00:03:36,530 --> 00:03:42,770 80 now create a sample for subtract and assignment operator. 38 00:03:43,250 --> 00:03:49,490 So first clear the last court a minus equals B. 39 00:03:51,950 --> 00:03:58,300 It's soft strikes, right or planned from the left or planned and assigned the reason to lift or print, 40 00:03:58,310 --> 00:04:01,790 it means a equals a minus B. 41 00:04:02,120 --> 00:04:11,870 Now we display the value of a variable, so we write up a equals comma, a save the project and execute 42 00:04:11,870 --> 00:04:12,590 the program. 43 00:04:16,460 --> 00:04:18,350 Now we can see the output. 44 00:04:18,350 --> 00:04:27,260 A variable value is equivalent to subtraction of variables A and B, and it's equals minus 20. 45 00:04:28,700 --> 00:04:32,570 Now create a sample for multiply and assignment operator. 46 00:04:33,020 --> 00:04:35,030 So clear the last quote. 47 00:04:37,620 --> 00:04:41,040 A multiplication equals B. 48 00:04:43,200 --> 00:04:49,200 It multiplies right operand with the left operand and assign the result to left footprint. 49 00:04:49,530 --> 00:04:53,340 It means a equals a multiplication. 50 00:04:53,560 --> 00:04:57,930 B Now go to the next line and display the value of a value. 51 00:04:58,230 --> 00:05:08,040 So we write up a equals comma, a save the project and execute the program. 52 00:05:10,830 --> 00:05:20,760 Now we can see the output a equals one thousand and 500, a variable value is equivalent to the multiplication 53 00:05:20,760 --> 00:05:22,680 of variables A and B. 54 00:05:23,190 --> 00:05:27,390 Now you want to create a sample for divide and assignment operator. 55 00:05:27,480 --> 00:05:29,700 So first clear the last code 56 00:05:32,640 --> 00:05:44,080 and we write a divide equals be it divided left operand with the right operation and assign the result 57 00:05:44,080 --> 00:05:45,120 to left operand. 58 00:05:45,360 --> 00:05:47,670 It means eight equals eight. 59 00:05:47,670 --> 00:06:00,360 Division B now go to the next line and display the value of a variable, so we write f b e equals comma 60 00:06:00,780 --> 00:06:04,580 a save the project, then execute the program. 61 00:06:08,740 --> 00:06:17,770 Now we can see the output a equals zero, the value of the variable A is equal to the division of the 62 00:06:17,770 --> 00:06:21,310 value that a buy B and it's zero. 63 00:06:23,610 --> 00:06:32,280 Now, create a sample for modules and assignment operator sofas clear the last got a. 64 00:06:33,640 --> 00:06:34,570 Modulus. 65 00:06:35,730 --> 00:06:37,680 Equals B. 66 00:06:39,500 --> 00:06:47,630 It takes modulus using two operations and assigns the result left operand, and it's means a equals 67 00:06:47,630 --> 00:06:57,800 a modulus b now go to the next line and display the value of a valid and so great FP a equals comma 68 00:06:58,250 --> 00:06:58,670 a. 69 00:07:00,200 --> 00:07:04,310 Reformat the code, save the project and execute the program. 70 00:07:07,720 --> 00:07:16,570 Now we can see the output eight equals 13, the value of variable A is equal to the reminder of the 71 00:07:16,570 --> 00:07:21,340 division of Variable A by B, and it's 30. 72 00:07:22,360 --> 00:07:22,750 OK. 73 00:07:22,930 --> 00:07:29,530 We were able to explain the assignment operators and give examples in order not to prolong the time 74 00:07:29,530 --> 00:07:30,310 of decision. 75 00:07:30,460 --> 00:07:34,150 We will finish it and we'll continue the content in the next session. 76 00:07:34,300 --> 00:07:34,840 Goodbye.