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()

Written by: RajaSekhar
  • 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);
}

 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
  • C Program to Convert Temperature from Degree Centigrade to Fahrenheit
  • C Program to Print Hello World
  • C Program for Sum of Digits of a Number using Recursion
  • C program to Print Triangle Pattern
  • C Program to Compare Two Strings using strcmp()
  • C Program to Find Number of Characters and Words in a String
  • C Program to Find Sum of 5 Subjects and Percentage
  • C Program for Addition of Two Numbers
  • C Program to Calculate Sum of Marks to Demonstrate Structures
  • C Program for Monthly Bill of a Newspaper
  • C Program for Fibonacci Series Using for Loop
  • C Program for Implementation of Predictive Parser
  • C Program to Sort List of Strings
  • C Program for Optimal Page Replacement Algorithm
  • C Program to Copy Contents From One File to Another
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top