Advertisement
silvana1303

add and subtract

May 28th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.Numerics;
  5. using System.Text;
  6.  
  7. namespace exampreparation
  8. {
  9.     class exam
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int number1 = int.Parse(Console.ReadLine());
  14.             int number2 = int.Parse(Console.ReadLine());
  15.             int number3 = int.Parse(Console.ReadLine());
  16.  
  17.            int sum =  Sum(number1, number2);
  18.            int substract = Substract(sum, number3);
  19.  
  20.             Console.WriteLine(substract);
  21.  
  22.         }
  23.  
  24.         static int Sum(int number1, int number2)
  25.         {
  26.             int sum = number1 + number2;
  27.             return sum;
  28.         }
  29.  
  30.         static int Substract(int sum, int number3)
  31.         {
  32.             int substract = sum - number3;
  33.             return substract;
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement