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 HelloWorld2a
- {
- class Program
- {
- static void Main(string[] args)
- {
- int age = -128;
- double money = 2.54D;
- char firstLetter = 'S'; // '\u000f';
- bool isMail = true;
- // int 2f1dhgf = 12; ERROR can not start with number
- string name = "Stoyan";
- object myObject = 5;
- bool pr = (1 + 2) * 8 % 4 > (23 + 45) % 34;
- Console.WriteLine("Please enetr your age?");
- string input = Console.ReadLine();
- int parsed = int.Parse(input);
- Console.WriteLine("You have entered: {1} {0}", ++parsed, age);
- Console.WriteLine("Hello World! And I am " + age + " years old!");
- Console.WriteLine("I have in my pocket : " + money);
- Console.WriteLine("The first letter of my name is: " + firstLetter);
- Console.WriteLine("Am I a man? : " + isMail);
- Console.WriteLine("My Name is " + name);
- Console.WriteLine("Result: " + pr);
- if (parsed < 20)
- {
- Console.WriteLine("You are an teenager!");
- }
- else if (parsed >= 20 && parsed <= 30)
- {
- Console.WriteLine("You are in a briliant stage of your life the! It is time for fun");
- }
- else if (parsed > 30 && parsed <= 40)
- {
- Console.WriteLine("Its time for a family life");
- }
- else {
- Console.WriteLine("You are an old man");
- }
- switch (parsed) {
- case 21 :
- case 20 :
- Console.WriteLine("switch You are in perfect age!");
- break;
- case 50:
- Console.WriteLine("switch You are in the middle of your life");
- break;
- default :
- Console.WriteLine("switch I don't know what to say");
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement