Find the length of string

QuestionsFind the length of string
akankshat.ngPublished on: 8/7/2020 7:14:18 PM

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

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
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);
getch();
}