Advertisement
SMASIF

C# - Concatenation of string and Addition of two numbers

Mar 12th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Runtime.InteropServices;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8.  
  9. namespace ConsoleApplication1
  10. {
  11.     class Program
  12.     {
  13.         static void Main(string[] args)
  14.         {
  15.             string FirstName = Console.ReadLine();
  16.             string SecondName = Console.ReadLine();
  17.             int a = Convert.ToInt32(Console.ReadLine());
  18.             int b = Convert.ToInt32(Console.ReadLine());
  19.  
  20.             Console.WriteLine(GetFullName(FirstName, SecondName));
  21.             Console.WriteLine(Add(a,b));
  22.             Console.ReadKey();
  23.  
  24.         }
  25.  
  26.         static int Add(int firstNumber, int secondNumber)
  27.         {
  28.             int sum = firstNumber + secondNumber;
  29.             return sum;
  30.         }
  31.  
  32.         static void Print()
  33.         {
  34.             Console.WriteLine("Hello from Print method");
  35.         }
  36.  
  37.         static string GetFullName(string firstName, string lastName)
  38.         {
  39.             string fullName = firstName + " " + lastName;
  40.             return fullName;
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement