Questions tagged [boolean]

The tag has no usage guidance.

12 questions
Filter by
Sorted by
Tagged with
140 views

I want to ask if there is a way to tell your programme to proceed with the code only when a boolean expression is false (not "true" as usual) and if the answer is yes, could you give me an example of ...
19 views

Week 2 Lecture - Functions - Valid Triangle

This is from the functions lecture on a valid triangle. I'm not getting any error messages but I can't figure out why the bool valid_triangle (float x, float y, float z) function is not working. Any ...
31 views

Week 2: valid_triangle function example — compiling [errors]

This goes to week 2: Functions mini lecture. We create a custom function for verifying whether we have a valid triangle by assessing it's 3 sides. I wanted to elaborate on the code. Since, this ...
25 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 ...
25 views

What's in the bool function parenthesis?

hope everyone is staying safe. I just want to understand what's inside the parenthesis of the vote function in pset3 - Tideman: bool vote(int rank, string name, int ranks[]) What does it mean to ...
47 views

Pset3 is_rest does not compile right?

I have some code I have written to test whether a blank line has been reached in the music file but I am not familiar with how to return a Boolean statement as true in C. When I run make I am getting ...
119 views

What is the return value when isalpha() evaluates to true?

I was running into an issue with my program for Vigenere's Cipher and singled it out to a problem with the equivalence of the value that is returned from isalpha() and the boolean "true". I now know ...
104 views

Pset4 recover.c compiles, but can't seem to print Jpgs at all

Am starting a new thread as I'm having trouble understanding what is wrong with the code.. I've added printf statements at the jpgCheck function and did not get a print. I suspect it's the function? ...
690 views

Pset4 recover, comparing hex in if statements

I'm trying to solve "recover" but, I'm unable to compare my if statements. This is my error message: error: comparison of constant 224 with expression of type 'char' is always false [-...
88 views

pset2 caeser boolean returns

when running the code below with a command line ./caesartest 2, I get the false return 1, not the true, what is wrong? (I began having the trouble after including isdigit)... #include <cs50.h> #...