what is the length of the string in strlen ("hello India") function..
Answers
String is any combination of alphanumeric characters enclosed in a double inverted coma. Here, "hello india" has 10 alphabets, but the space between two words is a whitespace character and count as an entity in len function.
Hence, length of the string is 11
Answer:
String Length which will return is 11.
Explanation:
The function strlen() is used to calculate length of string when we pass string as argument.
The value which return is of unsigned integer type.
strlen() function is found in header file named string.h and strlen() function counts white spaces too along with characters but, not a null character ‘\0’.
Program:
#include<stdio.h>
#include <string.h>
int main()
{
char str[]= "hello India";
printf("Length of string is: %d", strlen(str));
return 0;
}