try using the debugger to monitor what's happening when you select 2 in your proram. but looking at your code, are you sure it's scanf("%c", ...) instead of scanf("%s",...)? i know %c is used for a single character and %s for a string.