Write a function to calculate the length of a string without using strlen function using Command Line Programming

Please comment the code in the C/C++/Java/Python etc below –