what is for () function corrct use here : im trying to make a code that checks if a password contains a number an uppercase and a $ symbol with for function  but if i add the {} to the for function it wont work

 if i do it like this it wont work : 
/for(x=0;x<=10;x++) {if( isdigit(password[x])){ number++;}}/ why does removing the {} from for make it work



    #include <stdio.h>
    #include <stdlib.h>
    #include <ctype.h>
    #include <math.h>
    #include <string.h>
 
    int main()
    { int x=10,uppercase=0,number=0,dollar=0;
    char password [x];
    
    printf("enter password: ");
    scanf(" %s",&password );

    /*if i do it like this it wont work why ?
     for(x=0;x<=10;x++) {if(isdigit(password[x])){ number++;}} */


    for(x=0;x<=10;x++)
    if ( isdigit(password[x])){ number++;}

    for(x=0;x<=10;x++)
    if ( isupper(password[x])){ uppercase++;}

    for(x=0;x<=10;x++)
    if ( password[x]=='$'){ dollar++;}

    if( (number>=1)&&(uppercase>=1)&&(dollar>=1)){ printf("password saved");}else{ printf("invalid password");}

    return 0;}