LogiQuest
Back to Const
10

What will be the output of the program?

#include <stdio.h>
int len(const char *s) { int n = 0; while (*s++) n++; return n; }
int main(void) {
    printf("%d\n", len("hello"));
    return 0;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.