Find the length of string

QuestionsFind the length of string
akankshat.ngPublished on: 1/26/2021 9:26:53 AM

Write a C program which takes a string as input and displays its length. (Do not use built-in strlen function).


1 Answers
Answer is under review.

Find string length without using (strlen) function

void main()
char s[100];
int i;
printf("Enter a string: ");
scanf("%s", &s);

for(i=0; s[i]!='\0'; i);

printf("lenght of string: %d", i);