User Input Functions

These functions are used to take input from the user via the terminal(or command prompt).

SRON provides four functions for it:

  • inputInt()

  • inputDouble()

  • inputChar()

  • inputString()


1. inputInt():

This function is used to take 'Int' type input from user through terminal.

{
    name : Main

    Int val1 = inputInt("Enter two values :- ")

    Int val2 = inputInt()

    println(val1)
    println(val2)
}

Terminal :

Enter two values :- 12 13 12 13


2. inputDouble():

This function is used to take 'Double' type input from user through terminal.

Terminal :

Enter two values :- 27.06 20.03 27.060 20.030


3. inputChar():

This function is used to take 'Char' type input from user through terminal.

Terminal :

Enter two values :- S J S J


4. inputString():

This function is used to take 'String' type input from user through terminal.

Terminal :

Enter two sentences :- Saksham Rapid Object Notation Saksham Rapid Object Notation


Last updated