I'm sure you could figure that out???
But if the user put by wrong 'b' instead Y or N.. it will be as he hits Y ???
The inner while loop won't stop unless a y or n is input, it does everthing on one line as well, which is cool.
printf("Enter number of field: \n");
fgets(temp, sizeof(temp)-1, stdin);
sscanf(temp, "%d", &nfield);
printf("Are you sure %d fields \n",nfield);
while((sure = tolower(getch())) != 'y' && sure != 'n');
if(sure == 'n')
continue; /* start loop again */
break; /* leave loop */