Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Demo
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- PrintMessage();
- PrintInRange();
- String text = "9";
- PrintInRange();
- PrintMessage();
- Console.WriteLine("asdadas");
- PrintMessage();
- int number = 9;
- number += 9;
- PrintInRange();
- PrintMessage();
- PrintGreaterNumber(56, 87);
- }
- static void PrintInRange()
- {
- for (int i = 0; i < 10; i++)
- {
- Console.WriteLine("Test23423423");
- }
- }
- static void PrintMessage()
- {
- Console.WriteLine("This operation is succesfull!!!!!!!");
- }
- static void ModifyNumber()
- {
- }
- //static -> лесно да извиквам метода чрез неговото име
- //видове методи:
- //1. void -> отпечатва стойност или да модифицира стойност
- //2. връщат резултат
- //име на метода
- //1. PascalCase -> първата буква е главна и всяка следващта дума е също с главна буква
- //2. EN
- //3. Какво прави метода?
- //СЪЗАДАВАНЕ НА МЕТОД: static + вид на метода (void / връща резулатат) + име на метода + (параметри)
- static void PrintGreaterNumber (int number, int number2)
- {
- if (number > number2)
- {
- Console.WriteLine(number);
- }
- else
- {
- Console.WriteLine(number2);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement