Help me in solving CLB041 problem

My issue

why cant we write a instead of strlen(txt) function here , its showing wrong answer

My code

#include <stdio.h>
#include <string.h>

int main() {

  char txt[] = "NumeroTres";
  printf("The length of the word is: %d", a;

  return 0;
}

Learning course: Learn C
Problem Link: CodeChef: Practical coding for everyone

@ananyashinde24
U r not doing it right.
u can also find the length by iterating the string.
or else use strlen function like this

#include <stdio.h>
#include <string.h>

int main() {

  char txt[] = "NumeroTres";
  printf("The length of the word is: %d", strlen(txt));

  return 0;
}
1 Like

thanks