/*C program to Find Length of String Without using Library Function*/
#include<stdio.h>int main() {
char str[100];
int length;
printf("\nEnter the String : ");
gets(str);
length = 0; // Initial Length
while (str[length] != '\0')
length++;
printf("\nLength of the String is : %d", length);
return(0);
}
output
enter the stringkucet
the length of the string is : 5
Comments
Post a Comment