Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ITC1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Enter number: ");
- int n = int.Parse(Console.ReadLine());
- Console.Write($"Last digit name of {n} is: ");
- LastDigitName(n);
- PresentMe("Ivan", 20);
- }
- static void LastDigitName(int number)
- {
- //int lastDigit = number % 10;
- switch (number % 10)
- {
- case 0: Console.WriteLine("zero"); break;
- case 1: Console.WriteLine("one"); break;
- case 2: Console.WriteLine("two"); break;
- case 3: Console.WriteLine("three"); break;
- case 4: Console.WriteLine("four"); break;
- case 5: Console.WriteLine("five"); break;
- case 6: Console.WriteLine("six"); break;
- case 7: Console.WriteLine("seven"); break;
- case 8: Console.WriteLine("eight"); break;
- case 9: Console.WriteLine("nine"); break;
- }
- }
- static void PresentMe(string name, int age)
- {
- Console.WriteLine($"My name is {name}!");
- Console.WriteLine($"I am {age} years old!");
- Console.WriteLine("Bye bye");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement