The result was always invalid because according to your code result will be vaild if isdigit(a), isalpha(a) and isupper(a) are all true..means your code result will be "valid" if a character is alphabet and also a number..which is not possible so you always get invalid..
char a;//concept of array
scanf(" %s", &a); //alternately you can use gets(a);
int lengthOfString = strlen(a);//find out length of string
int conNum = 0;//this is currently set 0 but will become 1 if we find a digit...
int conAlpha = 0;//same as above , this will become 1 if we find a alphabet
int conUpper = 0;
conAlpha = 1;//if there is a alphabet at i'th position then we make it 1..
conNum = 1;
conUpper = 1;
if(conNum == 1 && conAlpha == 1 && conUpper == 1)//if all are one that means we found upper case, alphabet and a number
} //never-ever use semi-colon here
hope this helped...