strlen - Find length of the String in C

Finding the length of the given string
ie., if we have a string "ForgetCode"
Then as visually we can say that in the given strin we have 9 characters but here we have to program for this inorder to count we must to start from starting index of an array upto the null.
#include<stdio.h>
#include<string.h>
 
int main()
{
   char a[100];
   int length;
 
   printf("Enter a string to calculate it's length\n");
   gets(a);
 
   length = strlen(a);
 
   printf("Length of entered string is = %d\n",length);
 
   return 0;
}