Answers for "syntax for user int type input in dart"

0

Dart integer User input

import 'dart:io';

void main() {
  int value = stdin.readIntSync();
  print(value);
}

extension ReadIntSyncOnStdin on Stdin {
  int readIntSync() => int.parse(this.readLineSync());
}
Posted by: Guest on June-05-2021
1

how to take integer input from user in dart

import 'dart:io';

void main() {
  print("Enter a number..");
    var number = stdin.readLineSync();
    var intNumber= int.parse(number);
    print(intNumber);
}
Posted by: Guest on May-21-2021

Browse Popular Code Answers by Language