added switch case and scanf snippet