Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2 #include <stdio.h>
- 3 #include <stdlib.h>
- 4 void verify(int check);
- 5 void limit(int stop);
- 6 int main(void)
- 7 {
- 8 int s = 0;
- 9
- 10 printf("Enter a stopping value (0-100): ");
- 11 scanf("%i", &s);
- 12 verify(s);
- 13 limit (s);
- 14 return(0);
- 15 }
- 16 void limit(int stop)
- 17 {
- 18 int x = 0;
- 19
- 20 for(x=0; x<=100; x=x+1) {
- 21 printf("%i ", x);
- 22 if(x==stop) {
- 23 puts("You won!");
- 24 return;
- 25 }
- 26 }
- 27 puts("I won!");
- 28 }
- 29 void verify(int check)
- 30 {
- 31 int x = 0;
- 32
- 33 if(scanf("%i", &x)<= 100) {
- 34 if(x <= 100) {
- 35 printf("That value is TRUE and acceptable.\n");
- 36 return;
- 37 }
- 38 if(x > 101) {
- 39 printf("That value is FALSE and not acceptable.\n");
- 40 }
- 41 }
- 42 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement