So I'm working in C langauge with a GNU compiler. I'm trying to make it so that when the user puts in any values not between 0 and 3 it will enter a while loop and print an error. Whenever I run this line the program crashes
while ((dice<0) && (dice>3)){
printf("Error, you can only roll 0 through 3 dice!\n");
scanf("%d",dice);
}
pls help
>>57224926
> while dice is less than 0 and greater than 3
Man I hope this is bait..
>less than 0 AND greater than 3
Maybe read through your code sometimes?
>>57225077
>>57225068
oh shit, how does I or?
>>57224926int dice;
do {
printf("How many dice to roll (0-3)?\n");
scanf("%d", &dice);
} while (dice < 0 | dice > 3);
>>57225100
>>57225100
|| or OR should work, but start with the straight lines
>>57225100
wut
>>57225100
yes the or comparison operator is two uppercase I's
thanks guys, I realized I made it an and statement and it needs to be an or-- works now.
>>57225120
>inb4 II doesn't work
>>57225133
>>57225296
Don't be mean
>>57225494
eat shit and die