Advertisement
Kulasangar

Week 2 - out keyword

Dec 21st, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 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 ConsoleApplication2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int count = 0;
  14.             double D = 0;
  15.             int result = cal(5, 2, out count, out D);
  16.  
  17.             Console.WriteLine(result);
  18.             Console.WriteLine(count);
  19.             Console.WriteLine(D);
  20.             Console.ReadLine();
  21.  
  22.         }
  23.  
  24.         static int cal(int a, int b)
  25.         {
  26.             return a * b;
  27.         }
  28.  
  29.         static int cal(int a, int b, out int sum, out double divD)
  30.         {
  31.             sum = a + b;
  32.             divD = a / b;
  33.             return a * b;
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement