Write a program to calculate the length of following string :- “satik”
Answers
Answered by
1
Assuming that the answer has to be in C programming language, the solution code is as follows:
#include<stdio.h>
#include<string.h>
void main()
{
char str[5]=""""satik"""";
int length =strlen(str);
printf(""""The length of the string is %d"""", length);
}
Note: To find, the length of a given string, we have to use the strlen() in-built function.
The strlen() function is located inside the string.
So, it's necessary to import the string.h header file into your source code in order to use the strlen() method.
Similar questions