Answer the question
In order to leave comments, you need to log in
Why doesn't the && operator work?
What library needs to be included? Without &&
with one condition, it works fine, but it does not want to with it.
#include <cs50.h>
#include <stdio.h>
#include <stdlib.h>
int GetPositiveInt();
int main() {
int p = GetPositiveInt();
printf("THX 4 THE %d!\n", p);
return 0;
}
int GetPositiveInt()
{
int p;
do {
printf("ENTER NUM IN THE RANGE: ");
p = GetInt();
} while (p <=0 && p >= 23);
return p;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question