All Questions
3 questions
0
votes
1
answer
206
views
Why is it that the OR (||) doesn't work while the AND (&&) works in my program?
When I typed while (c != 'Y' || c != 'n' || c !='y' || c != 'N'); , my program just loops over, and over, and over again, even if I don't fulfil the condition, AKA, if I enter values Y, y, N or n. ...
0
votes
1
answer
56
views
PSET1 mario.c why if and return
I was banging my head with this. I had to look at others solutions to get my code to work. Here is the code I have, it works now but only because I looked at solution.
I had this code written minus ...
0
votes
1
answer
33
views
Do While loop not executing for pset3
I am working on Pset3 for a binary search algorithm. Below is my code (NOTE: the logic is not finished):
bool search(int value, int values[], int n)
{
//binary search algorithm
int min = 0;
int max = ...