C# program to check entered value is arithmetic operator, logical operator, conditional operator, relational operator or something else
Program Statement:
Write a program using switch statement which takes one character value from user and check whether the entered value is arithmetic operator, logical operator, conditional operator, relational operator or something else.
Solution:
static void Main(string[] args)
{
char ch;
int a;
Console.WriteLine("Enter any Character:");
ch = Convert.ToChar(Console.ReadLine());
a=(int)ch;
switch (ch)
{
case '+':
case '-':
case '*':
case '/':
case '%':
Console.WriteLine("Entered Character is Arithmetic");
break;
case '&':
case '|':
case '!':
Console.WriteLine("Entered Character is Logical Operator");
break;
case '?':
case ':':
Console.WriteLine("Entered Character is Condational Operator");
break;
case '<':
case '>':
case '=':
Console.WriteLine("Entered Character is Relational Operator");
break;
default:
Console.WriteLine("Entered Character is something else not included i n list");
break;
}
Console.ReadLine();
}
If you are interested in an advanced Digital marketing course in Ghaziabad you can any time contact us to get more details on the course and take other information like fee and other details
BalasHapusdigital marketing institute in noida
digital marketing course in ghaziabad
seo course in laxmi nagar
It us an amazing blog, As an Essay Writer I would say that this is fascinating reading, really this is more than pleasure for me to read this blog. you did a great job.Thanks a lot lot for sharing the great and unique information with us.
BalasHapusHey, it is very good to see people helping each other like you did in above blog providing learning blog about computer programming. I also help students with Essay Writing. I work for Essay Writing Service Pakistan. It is the best essay writing service in Pakistan.
BalasHapus