Questions tagged [ifstatements]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
23 views

Else If Boolean Statements of Equality In the Case of Complex Numbers

In the lecture for Week 1, Professor Malan said that in an if statement, the third boolean expression (else if (x ==y)) is redundant or implied, since logically, if it is false that a number is ...
0
votes
1answer
23 views

If statement: evaluating if my variable equals one of 2 values (C)

I am trying to evaluate if my two variables each match one of multiple values in an if statement. I'm trying: if ( ( variable1 == A || B ) && ( variable2 == C || D ) ) Error: use of ...
0
votes
1answer
13 views

Pset 7 if statement issue

I have an issue with an if statement that does not match condition in my application.py. However, when I test the same statement in a test script with real values instead of variables, it works as ...
1
vote
1answer
67 views

What is the logical difference between if (isupper(text[i]) == true) and if (isupper(text[i]))?

In my original code I had this: if (isupper(text[i]) == true) { int j = (int) text[i] % 65; int k = (j + key) % 26; char l = (char) k + 65; ...