What you are trying to do is more of a logical issue. You are attempting to catch input when it is a 0 or a 1. Your logic 'Looks' like good logic, but really it isn't.
Let me explain what you are saying:
if (value != 0||1)
What this means is this, If the variable value is not equal to undefined then do this.
What you mean is this,
If the variable value is not equal to 0 AND the variable value is not equal to 1 then do this.
Simply put you are confusing the || or comparitor. You need to have 2 tests, but you only have one.
As to the Loop, here is an example of what I think you wanted.
#include
"stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
//Create two string arrays, one upper, one lower.
char string1[27] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char string2[27] = "abcdefghijklmnopqrstuvwxyz";
//Create an integer to catch the user input.
int value = 0;
// create a loop to prompt the user.
While (value == 0)
{
printf(To print the alphabet in\n");
printf("uppercase enter 1\n");
printf("lowercase enter 2\n");
scanf("%i",&value);
} //end of while loop
// Test the input, if the input is not 1 and input is not 2,
if ((value != 1)&&( value != 2))
{
printf("Invalid entry please enter only 0 or 1");
}
// If the input is a one, send the Upper Case String.
else if (value == 1)
{
printf("%s",string1);
}
// If the input is two, send the Lower Case String.
else if (value == 2)
{
printf("%s",string2);
}
//exit the program.
return 0;
}