C Programming: Find the length of a string
2. String Length Without Library
Write a program in C to find the length of a string without using library functions.
Sample Solution:
C Code:
Output:
Find the length of a string : --------------------------------- Input the string : w3resource.com Length of the string is : 15
Flowchart:
For more Practice: Solve these Related Problems:
- Write a C program to compute the length of a string recursively without using any library functions.
- Write a C program to determine the length of a string using pointer arithmetic without looping explicitly.
- Write a C program to calculate a string’s length by iterating over its characters until the null terminator is reached.
- Write a C program to read a string from a file and calculate its length manually without library support.
C Programming Code Editor:
Improve this sample solution and post your code through Disqus.
Previous: Write a program in C to input a string and print it.
Next: Write a program in C to separate the individual characters from a string.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.