Print Table of Number

import 'dart:io';//1
main(List<String>arguments)
{
  print("Enter a Number");//2
  var value = int.parse(stdin.readLineSync());//3
  for(int i=1;i<=10;i++)//4
    {
      print("$value*$i=${value*i}");//5
    }

}
  1. import statement for input and out-stream lib for Dart
  2. Instruct to user enter a number
  3. Take input from the user and convert into int and assign to value
  4. Execute for loop start from 1 till 10
  5. For loop, every irritation calculate the value and print the result

Output

Enter a Number
10
10 *1=10

10*2=20

10*3=30

10*4=40

10*5=50

10*6=60

10*7=70

10*8=80

10*9=90

10*10=100

Leave a Reply

Your email address will not be published. Required fields are marked *