main function

void main()

Implementation

void main() {
  stdout.write("Enter a number: "); // Prompts the user to enter a number
  String userInput = stdin.readLineSync()!; // Reads user input as a string
  int x = int.parse(userInput); // Converts the user input string to an integer
  print(x.toRadixString(16)); // Prints the hexadecimal representation of the input number
}