#include <stdio.h>
#include <string.h>
int main()
{
char a[100]=”alfatechlab”;
int length;
length = strlen(a);
printf(“Length of the string = %d\n”, length);
return 0;
}
#include<iostream>
using namespace std;
int main()
{
string str = “alfatechlab”;
// you can also use str.length()
cout << “Length of the string = ” << str.size();
return 0;
}
public class Main {
public static void main(String[] args) {
//declare the String as an object S1 S2
String S1 = “alfatechlab”;
//length() method of String returns the length of a String S1.
int length = S1.length();
System.out.println(“Length of the string = ” + length);
}
}
str1 = “alfatechlab”
print(“Length of the string =”,len(str1))
$str1=strlen(“alfatechlab”);
echo “Length of the string = $str1”;