Flashcards
Sem título
Flashcards do conjunto (1)
- 1What does the following line of code do? SET result TO a * 5What does the following line of code do?
SET result TO a * 5
You said:
Multiplies whatever is in the variable called 'a' by 5, and then stores the answer in a variable called 'result'
Correct
The * (asterisk) is the programming version of the multiply sign in maths. Thus this piece of code will take whatever is stored in the variable that is called 'a' and then multiply it by 5. Whatever the answer to this sum is then stored in the variable that is called 'result'. If the number 10 is stored in the variable 'a' then this code would multiply 10 by 5 and the answer (50) would be store in the variable called 'result.'
2
Which of the following lines of code would divide one variable by another variable and store the answer in another variable?
You said:
SET result TO a/b
Correct
The / (slash) is the programming version of the divide sign in maths. Thus this piece of code will take whatever is stored in the variable that is called 'a' and then divide it by b. Whatever the answer to this sum is then stored in the variable that is called 'result'. If t
Informações
- Descrição
- FlashCards sobre Sem título, criado por danyar hassan em 21-03-2018.
- Criado por
- danyar hassan
- Visualizações
- 0
- Avaliação
Mais sobre Operators and Boolean Logic