Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- #define MAX 101
- int lengthrecursive(char *string)
- {
- if(*string=='\0')
- return 0;
- else
- return 1+lengthrecursive(string+1);
- }
- int main()
- {
- char string[MAX];
- gets(string);
- printf("%d",lengthrecursive(string));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment