SHARE
TWEET

תרגיל 3. החלפת ערכי משתנים

Shtiler Sep 18th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace homework_3
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int num1, num2, temp;
  14.             Console.WriteLine("First Number");
  15.             num1 = int.Parse(Console.ReadLine());
  16.             Console.WriteLine("Second Number");
  17.             num2 = int.Parse(Console.ReadLine());
  18.             temp = num1;
  19.             num1 = num2;
  20.             num2 = temp;
  21.             Console.WriteLine("After Swapping");
  22.             Console.WriteLine("First Number : " + num1);
  23.             Console.WriteLine("Second Number : " + num2);
  24.             Console.ReadLine();
  25.  
  26.         }
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top