Get The Number of Characters in a String using Function
The code will get the number of character assigned in a variable and used a StrLen Function or the length of a string character functions
OUTPUT
#include<stdio.h>
#include<string.h>
void main(void)
{
char str[31];
int len;
printf("\nEnter any String: ");
gets(str);
len=strlen(str);
printf("\nNumber of Character in %s = %d\n",str,len);
}
Get The Number of Characters in a String using Function
Reviewed by code-dev
on
4:46 PM
Rating:
No comments: