Solution :
Please learn to use the Debugger, it will help you to see that what your code is doing, believe in me, it will help you to understand what is wrong.
When you don’t know what your code should be doing or why the does what it does, the answer to this is Debugger.
You can use the debugger to see what your code is actually doing. You need to just set a breakpoint and see how your code is performing, the debugger allows you to execute the lines 1 by 1 and to inspect the variables as it executes it, it is an incredible learning tool.
The debugger is always here to show you what your code is doing and your task is to compare it with what it should be doing.
Code solution as below :
#include <stdio.h>
#include <string.h>
int main(void) {
char userInputArray[50] = "";
int stringInputSize = 0;
strcpy(userInputArray, "Hello");
stringInputSize = strlen(userInputArray);
printf("Size of userInputArray: %d\n", stringInputSize);
return 0;
}