Answer:
Hi!
The following Javascript statement compares if num is 2 or 5 and increment num by 1 if true.
if ( num==2 || num==5)
num = num +1;
Explanation:
The operator == is used to compare if the operands are equal.
The operator || is OR.
- If at least one of the operands is true then return true.
- If all operands are false returns false.
if( num==2 || num==5)
<em> // if num is equal 2 or if num is equal 5</em>
num = num +1; <em>// adds 1 to num.</em>
When you select 'ask your question' a box will appear and it will ask you to write your question. Underneath the text box you'll see a 'pi' sign and an 'omega' sign and next to that you'll see a paperclip sign. Click the paperclip sign and then choose the file/s you want to attach.
I have attached a docx (document) if you don't get what i mean.
Hope it helped :)
Answer:
Number 1 would be the answer and most safest one to choose.
Answer:
import random
number1 = random.randrange(0, 1000)
number2 = random.randrange(0, 1000)
answer = int(input("Enter a number: "))
if answer == number1 + number2:
print("Your answer is correct")
else:
print("Your answer is not correct")
Explanation:
The code is in Python
Create two integer numbers using random
Ask the user for an input
Check if answer is equal to number1 + number2. If they are equal, print "answer is correct". Otherwise, print "answer is not correct".