90. Implement Custom strlen Function

Back To All Submissions
Previous Submission
Next Submission

Code

#include<stdio.h>
int main()
{
    int len=0,i=0;
    char str[100];
    scanf("%[^\n]s",str);
    while(str[i++] != '\0')
    {
        len++;
    }
    printf("%d",len);

}

Solving Approach

 

 

 

Was this helpful?
Upvote
Downvote