HCL interview question

Write code for strlen