Questions tagged [logicaloperators]
The logicaloperators tag has no usage guidance.
7
questions
0
votes
0
answers
8
views
logical sentences
The following question will ask you about the following logical sentences.
If Hermione is in the library, then Harry is in the library.
Hermione is in the library.
Ron is in the library and Ron is ...
1
vote
1
answer
31
views
Making code neater: a way to reduce repeated logical operators?
For CS50 pset1 Credit I'm using repeated logical-OR operators (||) to work out the validity and card brand of a credit card number. When I evaluate the style of my code using style50 it says to insert ...
0
votes
1
answer
66
views
PSET4 Recover - Problem with my code
I'm Samuel and currently working on problem set 4 of CS50x recover. I have given it my best shot but came across an error:
error: using the result of an assignment as a condition without parentheses [...
0
votes
1
answer
37
views
If condition with lots of conditions and logical operators. Getting a parenthesis error, need help
Edit: I had used $$ instead of && as an AND operator. The person below pointed that out to me. Removing the OG question because I had posted my code in it.
0
votes
1
answer
48
views
What is causing this compiler error in my logical operators?
I have a question about logical operators. I've written some code for Pset3, Game-of-Fifteen, as part of the "MOVE" function. This code aims to determine whether "tile" is in a "legal" position to ...
0
votes
1
answer
66
views
PSET4 Recover: parentheses and order of operation && ||
I was wondering if you could use parentheses to group logical and/or "&& ||".
I am writing up the part where I check if the file block is a jpeg and having saved the 512 byte array. I check:
...
0
votes
2
answers
189
views
Pset 4 recover seg fault
/**
* recover.c
*
* Computer Science 50
* Problem Set 4
*
* Recovers JPEGs from a forensic image.
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
typedef ...