Documentations - SRON
  • SRON's Official Documentation
  • Installation
  • Syntax of SRON
  • Executing a SRON code
  • Keywords in SRON
  • Comments in SRON
  • Datatypes in SRON
  • Variables in SRON
  • Memory Ownership Model
  • Operators in SRON
  • Math block
  • if elif else in SRON
  • Loops in SRON
    • For Loop
    • While Loop
    • Foreach Loop
  • Break & Continue
  • Functions in SRON
    • Print functions
    • User Input Functions
    • Type Conversion functions
    • Type Checking functions
    • Math functions
    • Char Functions
    • String Functions
    • List Functions
    • Miscellaneous functions
  • Return in SRON
  • Command Line Arguments
  • Free
  • Rotate
  • Console
  • Sample codes
  • Coding Convention
  • Frequently Asked Questions
  • Credits
  • Contact
  • Donate
Powered by GitBook
On this page
  • 1. input_int():
  • 2. input_double():
  • 3. input_char():
  • 4. input_string():
  1. Functions in SRON

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


PreviousPrint functionsNextType Conversion functions

Last updated 1 year ago