I want to exit a while() when the user enters a negative number of any size. What kind of condition would I need at the start of the loop to get the loop to exit w
while()
Do not define your variable as unsigned variable. As suggested in other answers use if statement and break with if statement.
example:
int main(void) { int i; while(1){ /*here write an statement to get and store value in i*/ if(i<0) { break; } /*other statements*/ return(0); } }