Question

Complete the C function to calculate the length of a null-terminated string s without using strlen. int custom_strlen(const char*
s) {     int length = 0;     while (_________ ) { // Line to complete         length++;     }     return length; }

A s[length] != '\0'
B s[length] == '\0'
C s != NULL
D s[length]
E *s != '\0'
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)