using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Assignment2
{
class Program
{
static void Main(string[] args)
{
You are converting a
to an int but your switch statement is matching it to strings. Change it to case 1:
instead of case "1"
to fix the issues.
Remove quotes in case. i.e.
Replace case "1":
with case 1:
The offending code are your case statements. a
is an int
. Your case statements all use string
s. Simply remove the quotes around the numbers:
switch(a)
{
case 1:
// some code
break;
case 2:
// some code
break;
// rest of cases
}