C Program to find the length of String without using strlen
#include<stdio.h> int main(){ char mystring[] = "Hello CodeCry !"; int length = 0; while(mystring[length] != '\0'){ length++; } printf("Length of the given string : '%s' is : %d",mystring,length); return 0; }
Length of the given string : 'Hello CodeCry !' is : 15
mystring
and assign a sample valuelength
and initialize it to 0length
if the character is not