stefan1919

MethodsComplete

Oct 30th, 2015
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.35 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             //PrintSomething();
  14.             //Sum Method Normal
  15.             //int a = 5;
  16.             //int b = 6;
  17.             //Console.WriteLine(Sum(a, b));
  18.             //int result = Sum(a, b);
  19.             //Console.WriteLine(result);
  20.             //More than one value
  21.             //int a;
  22.             //int b;
  23.             //MoreThanValue(out a, out b);
  24.             //Console.WriteLine(a);
  25.             //Console.WriteLine(b);
  26.             //More Than One value using ref
  27.             //int i = 5;
  28.             //int b = 1;
  29.             //MoreThanOneRef(ref i, ref b);
  30.             //Console.WriteLine(i);
  31.  
  32.         }
  33.         //static void PrintSomething()
  34.         //{
  35.         //    //Console.WriteLine("This method was called");        
  36.         //}
  37.         //Sum Method Body
  38.         //static int Sum(int a, int b)
  39.         //{
  40.         //    return a + b;
  41.         //}
  42.         //static void MoreThanValue(out int a, out int b)
  43.         //{
  44.         //   a = 5;
  45.         //    b = a + 5;
  46.         //}
  47.         //static void MoreThanOneRef(ref int i, ref int b)
  48.         //{
  49.         //    i = b + 1;
  50.         //}
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment