Thanks again!

I've tried to put the error checking into a function prototype which works...kind of..

Here's the code in the function I have called Check..

Code:
int Check(int a){
    char vld[80];
    int chk;


    do {
        printf("\n\t\t                = ");
        gets(vld);
        chk = sscanf(vld, "%d",&a);
    
    if (chk != 1)
       {    printf ("\n             ERROR; You have entered a character.  Please Enter a number!\n"); }
    else
    if (a < 0 || a > 4)
       {    printf ("\n             You have entered a number out of range.\n             Please re-enter!\n"); }
               
       }   while (a < 0 || a > 4);


}
I have called this code here in main....

Code:
printf("\n  CREATE SIZE of Matrix A [MAX 4 X 4 Matrix]:\n");                          
        printf("\n             Number of Rows [R]");
        printf("\n             ..................");
        Check(RowA);
        printf("\n %d",RowA);            
        
        printf("\n          Number of Columns [C]");
        printf("\n          .....................");
        Check(ColA);
        printf("\n %d",ColA);
However, it is not storing the user number entered into the variable RowA (or ColA), as you can see by the printf's I've inserted to check what is actually going into them.

Why is it not storing the number as expected? For example, if I enter 3, what actually goes into RowA is a random number e.g. 7682520

Thank you!