Advertisement
Guest User

Rekenmachine (+)

a guest
Aug 29th, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 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 Rekenmachine
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("Geef een getal:");
  14.             string sGetal1 = Console.ReadLine();
  15.             Console.WriteLine("Geef nog een getal:");
  16.             string sGetal2 = Console.ReadLine();
  17.             Console.WriteLine("Voer een plus in:");
  18.             string sOperator = Console.ReadLine();
  19.  
  20.             int iGetal1 = int.Parse(sGetal1);
  21.             int iGetal2 = int.Parse(sGetal2);
  22.  
  23.             if (sOperator == "+")
  24.             {
  25.                 int iUitkomst = iGetal1 + iGetal2;
  26.                 Console.WriteLine("de uitkomst van de soms is {0} + {1} = {2}", iGetal1, iGetal2, iUitkomst);
  27.  
  28.             }
  29.             Console.ReadLine();
  30.                
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement