Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a program to find the length of a string stored in a variable str.

Easy

Problem Statement

Write a program to find the length of a string stored in a variable str.

Sample Input

str = "Hello"

Sample Output

5

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
// Declare a string variable and print its length let str = "Hello"; console.log();
Log in or sign up to run or submit your code.Log inSign up
Input
str = "Hello"
Expected Output
5