As per the link C Switch-case curly braces after every case , the below code should not compile since the variable is declared within switch without braces.
case 2:
int s = 0;
printf("enter side value:");
scanf("%d", &s);
printf("area of square is %d", squarearea(s));
break;
However lot of online c editors ( https://www.onlinegdb.com/online_c_compiler , https://www.programiz.com/c-programming/online-compiler/ ) are allowing this program to compile and run .
Why is it so ? These online compilers are claiming to use gcc but then why is this difference in behavior?