Logic Flashcards
1
Q
If Statement
A
var num = 5;
if(num == 5){
print(num);
}
2
Q
If Else
A
var num = 5;
if(num == 5){
print(num);
} else {
print (“not 5”);
}
3
Q
If Else If
A
var num = 5;
if(num == 5){
print(“Equals 5”);
}
else if(num == 4){
print(“Equals 4”);
}
else {
print(“Not 4 or 5”);
}
4
Q
Allowed Operators
A
> <
<=
=
!=
&&