programming9
  • Flowcharts
  • Programs
      • Back
      • C Programs
      • C++ Programs
      • Java Programs
      • Python Codes
      • HTML Codes
      • Java Script Codes
      • SQL Codes
  • Tutorials
      • Back
      • Java Tutorials
      • Competitive Programming
      • Python Tutorials
      • C Programming
  • Blog
  • Login

C Program to Find Length of a String Using STRLEN()

Details
Written by: RajaSekhar
Category: C Programs
  • C Functions
#include <stdio.h>
#include <string.h>
main()
{
    char s1[20];
    int len;
    printf("\nEnter any string: ");
    gets(s1);
    len = strlen(s1);
    printf("\nLength of string: %d", len);
    getch();
}

 OUTPUT:

Enter any string: programming9.com

Length of string: 16

C Program to Find Length Of a String With out Using Strlen() Function

Previous article: C Program to Implement Call By Value using Functions Prev Next article: C Program to Find Number of Characters and Words in a String Next
  • Swapping of Two Numbers Using Call By Reference in C
  • Implementation of Queue using Array in C
  • C Program to Delete Characters from Given String
  • C Program to Implement CONTINUE statement
  • C Program to Convert Infix to Postfix Expression using Stack
  • C Program to Find Area of a Triangle
  • C Program to Calculate Sum of Odd Values in an Array
  • C Program to Find Sum of Individual Digits of a Positive Integer Number
  • C Program to Implement RADIX SORT
  • C Program for Monthly Bill of a Newspaper
  • C Program for String Concatenation without using strcat()
  • Bubble Sort in C
  • C Program to Find the Prime Numbers
  • C Program to Find Radius and Circumference of a Circle
  • C Program to CONCATENATE Two Strings using strcat()
  • Privacy Policy
  • Cookie Policy
© programming9.com 2026
Back to top