Write a program in C to find the length of a string without using library function.
#include#include int main() { char str[10]; int length; printf("\nEnter the String : "); scanf("%s", str); length = 0; while (str[length] != '\0') length++; printf("\nLength of the String is : %d", length); return (0); }
0 comments:
Post a Comment