ЁЯУв Too many exams? DonтАЩt know which one suits you best? Book Your Free Expert ЁЯСЙ call Now!


    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' Correct Answer Incorrect Answer
    B s[length] == '\0' Correct Answer Incorrect Answer
    C s != NULL Correct Answer Incorrect Answer
    D s[length] Correct Answer Incorrect Answer
    E *s != '\0' Correct Answer Incorrect Answer

    Solution

    The correct answer is A

    Practice Next
    More IT Operating System Questions
    ask-question