Option A is the correct function to find the length of given string. Example: #include<stdio.h> int xstrlen(char *s) { int length=0; while(*s!='\0') { length++; s++; } return (length); } int main() { char d[] = "IndiaBIX"; printf("Length = %d\n", xstrlen(d)); return 0; } Output: Length = 8
Which of the following function is correct that finds the length of a string?
Review the verified answer and explanation for this DemoPaper-Pakistan past-paper question on CampusFin.
Question context
This question is part of 💡 C Programming within the broader 💻 Programming subject and appears in the DemoPaper-Pakistan preparation collection. Reviewing the answer together with nearby questions helps reinforce the underlying concept and identify how it may appear in competitive exams.