Peaches is spot on, Try this:
Code:
#include <stdio.h>
#include <string.h>
int main (void)
{
char a[7]; // needs one extra for the \0
clrscr();
printf("Please enter the Model Number? ");
scanf("%s", a); // dodgy scanf!!!
if (!strcmp(a, "123abc" ))
printf("Shelf 5");
else if (!strcmp(a, "456def" ))
printf("Shelf 4");
else if (!strcmp(a, "12ab54" ))
printf("Shelf 3");
else if (!strcmp(a, "76fred" ))
printf("Shelf 2");
else if (!strcmp(a, "21jufs" ))
printf("Shelf 1");
else
printf("Unknown");
return 0;
}
The if else is better as you only check enough to find the right one, also I added an option for incorrect entries.