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:

input_int() input_double() input_char() input_string()


1. input_int():

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

{
    name : MAIN

    1 : Int val = input_int("Enter two values :- ")

    0 : val = input_int();
}

Terminal :

Enter two values :- 12 13


2. input_double():

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

{
    name : MAIN

    1 : Double val = input_double("Enter two values :- ")

    0 : val = input_double();
}

Terminal :

Enter two values :- 12.12455 13.91249


3. input_char():

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

{
    name : MAIN

    1 : Int val = input_char("Enter two values :- ")

    0 : val = input_char();
}

Terminal :

Enter two values :- S @


4. input_string():

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

{
    name : MAIN

    1 : Int val = input_string("Enter two sentence :- ")

    0 : val = input_string();
}

Terminal :

Enter two sentences :- Hello SRON Wassup


Last updated