Advertisement
ezidan

task13

Dec 27th, 2022
1,037
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.24 KB | None | 0 0
  1. import 'dart:io';
  2.  
  3. void main() {
  4.   print("Task 13: ");
  5.   num listTotal = 0;
  6.   var myList = [1, 3, 5, 6, 8, 9, 22];
  7.   for (int i = 0; i < myList.length; i++) {
  8.     listTotal += myList[i];
  9.   }
  10.   print("Total of numbers in the list is: $listTotal");
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement