Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(void) {
- int x;
- char buf[BUFSIZ];
- int first = 0;
- printf("Input: ");
- while (1) {
- if (first) {
- printf("Re-input: ");
- }
- first = 1;
- fgets(buf, BUFSIZ, stdin);
- x = atoi(buf);
- if (100 <= x && x <= 500) break;
- }
- printf("input = %d\n", x);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement