filmov
tv
Dart | Calculate the Sum of two Number #shorts
![preview_player](https://i.ytimg.com/vi/lcSCg_eErSI/maxresdefault.jpg)
Показать описание
#shorts #dart
This Dart program declares three integer variables, num1, num2, and sum, initializes num1 to 10, num2 to 20, and calculates the sum of the two numbers and stores the result in the sum variable. It then prints out a string using string interpolation, which substitutes the values of num1, num2, and sum into the string. The output of the program would be The sum of 10 and 20 is 30. The program demonstrates basic variable declaration, arithmetic operation, and string interpolation in Dart.
This Dart program declares three integer variables, num1, num2, and sum, initializes num1 to 10, num2 to 20, and calculates the sum of the two numbers and stores the result in the sum variable. It then prints out a string using string interpolation, which substitutes the values of num1, num2, and sum into the string. The output of the program would be The sum of 10 and 20 is 30. The program demonstrates basic variable declaration, arithmetic operation, and string interpolation in Dart.