Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Rextester
- {
- public class Program
- {
- public static void PrintSumOf(int a, int b)
- {
- int sum = a + b;
- Console.WriteLine("Sum of " + a + " and " + b + " is " + sum);
- }
- public static void Main(string[] args)
- {
- PrintSumOf(1, 2);
- PrintSumOf(12, 59);
- //А так бы пришлось писать
- int a1 = 1;
- int b1 = 2;
- int a2 = 12;
- int b2 = 59;
- int sum1 = a1 + b1;
- Console.WriteLine("Sum of " + a1 + " and " + b1 + " is " + sum1);
- int sum2 = a2 + b2;
- Console.WriteLine("Sum of " + a2 + " and " + b2 + " is " + sum2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement