int foo(char c)
{
switch(c)
{
case '1':
return(1);
case '2':
return(2);
}
}
int main()
{
cout << foo('a');
}
This program prints 97 .
** It prints the ASCII value as output if none of switch case matches. Why is the function returning the ASCII value if none of the cases match**