Input Table
Abbreviation
|
Meaning
|
m
|
metre
|
kg
|
kilogram
|
s
|
second
|
a
|
ampere
|
k
|
kelvin
|
//Source code in C Sharp
using System;
namespace Application_Abbreviation
{
class Program_Abbreviation
{
static void Main(string[] args)
{
string abb;
Console.WriteLine("Enter an abbreviation: ");
abb = Convert.ToString(Console.ReadLine());
switch (abb)
{
case "m":
Console.WriteLine("metre ");
break;
case "kg":
Console.WriteLine("kilogram ");
break;
case "s":
Console.WriteLine("second ");
break;
case "a":
Console.WriteLine("ampere ");
break;
case "k":
Console.WriteLine("kelvin ");
break;
default:
Console.WriteLine("\nInvalid abbreviation");
break;
}
}
}
}
OUTPUT
Enter an abbreviation:
kg
kilogram
No comments:
Post a Comment