the output of the TEST using C doesnt conform to the output mentioned in the Question ! on the other hand this solves the problem to a far greater extent
#include<stdio.h>
#include<conio.h>
int main()
{
char num[2]={-1,-1};
while(1)
{
if((num[0]=='4')&&(num[1]=='2'))
continue;
else
{
num[0]=getch();
num[1]=getch();
if((num[0]=='4')&&(num[1]=='2'))
continue;
printf("%c%c\n",num[0],num[1]);
}
}
return 0;
}