Search This Blog

Loading...

Strlen()

/* This program will print the length of the string entered by user. */

#include<stdio.h>
#include<string.h>

void main(void)
{

char str[30];

int len;

printf("\nEnter any String : ");

gets(str);

len=strlen(str);

printf("\nNumber of Character in%s=%d\n",str,len);

getch();
}

No comments:

Post a Comment