Q: I keep getting the error "uninitialized local variable '_ 'used" even though in if statements I initialize variables Here is the program I wrote to try to find the largest and smallest of 4 integers. If I do define the variables before the if statements it removes the error but gives me just the original numbers instead, completely untouched.
int I, II, III, IV;

printf("Enter four different integers: ");
scanf("%d %d %d %d", &I, &II, &III, &IV);

int s, l;

if (I > II)
{
    I = l;
    II = s;
}
else
{
    I = s;
    II = l;
}

if (III > s)
{
    if (l < III)
    {
        III = l;
    }
}
else
{
    III = s;
}

if (IV > s)
{
    if (l < IV)
    {
        IV = l;
    }
}
else
{
    IV = s;
}

printf("\nLargest: %d\n", l);
printf("Smallest: %d\n", s);

Way to replicate mistake:
int I;
int a = 1;

a = I;


A: The assignment operator copies the value in righthand to the variable in lefthand.
You have to swap lefthand and righthand operator of all of your usage of =.
For example, you should write s = I; instead of I = s;.
