I am having trouble with this code, when I run it an error message comes up saying that the prog has performed an illegal option. I cannot see what the problem is, can you help please.



#include <stdio.h>

main()
{
char choice1 = 'Z';
int j = 0;
char Y[]="Y";
char N[]="N";
printf("\nPlease conform that these details are correct (Y/N)");
choice1 = getchar();
getchar( );

if(strcmp(Y, choice1))
{
printf("1 student record saved to file");
j=j+1;
}
else
{
if((strcmp(choice1, N))==1)
{
printf("in if 1");
}
else
{
printf("\n Not a valid option");
}
}
return 0;
}