Set a value to the variable

arte-semaki

Senior Member
Russian - Russia
Can I pronounce the expression x:=20 as "set a value of 20 to the variable x" and "set the value 20 to the variable x"?
 
Last edited:
  • TimLA

    Member Emeritus
    English - US
    variable x is set to 20
    variable x is assigned the value of 20
    variable x is assigned the value 20
    variable x is given the value of 20
     

    arte-semaki

    Senior Member
    Russian - Russia
    Thank you, but I need the active voice like "Guys, let's set a value of 20 to the variable x". I'd like to know if the phrase "set a value of 20 to the variable x" is grammatically correct.
     
    Last edited:

    baldpate

    Senior Member
    UK, English
    ... I need the active voice like "Guys, let's set a value of 20 to the variable x" ...
    If you need the active voice, then the verb you should use is "assign" :
    "Guys, let's assign a value of 20 to the variable x":tick:
    "Guys, let's set a value of 20 to the variable x":cross:
     

    arte-semaki

    Senior Member
    Russian - Russia
    I think I have sorted out the problem:
    I can assign a value to a variable, and I can set a variable to a value (for example, "Let's assign 20 to x", "Let's set x to 20").
    Am I right?
     
    < Previous | Next >
    Top