#include<stdio.h>
int get_len(char *s)
{
int len = 0;
while(s[len] != '\0')
len++;
return len;
}
int main()
{
char *s = "";
int len = get_len(s);
printf("%d",len);
return 0;
}
a) if(string[len] == 1) return 1
b) if(string[len+1] == 1) return 1
c) if(string[len] == ‘\0’) return 0
d) if(string[len] == ‘\0’) return 1
Which of the following can be the base case for the recursive implementation used to find the length of a string?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Which of the following can be the base case for the recursive implementation used to find the length of a string?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!