Program for string function strlen() in c programming language

/* Program for string function strlen() in c programming language .*/

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
  char str1[20];
  int length;
  clrscr();
  puts("Enter your string :");
  gets(str1);
  length=strlen(str1);
  printf("The length of string is : %d",length);
  getch();
}
===============

OUTPUT:-
Enter your string :
Linux                                                                          
The length of string is : 5

Comments