Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char *small (char *num)
- {
- static int i=0;
- if (num[i+1] == '\0')
- return NULL;
- if (num[i] > num[i+1])
- return &num[i];
- printf("%c, %c", num[i],num[i+1]);
- i++;
- return small(num);
- }
- int main()
- {
- char *c = "1234";
- char *p = small(c);
- if (p == NULL)
- printf("null");
- else
- printf("%c",*p);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement