AalborgHTX

Untitled

Dec 12th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace Variablecasting
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void button1_Click(object sender, EventArgs e)
  21.         {
  22.             int intTal = 5;
  23.             float floatTal = 5.5F;
  24.             double doubleTal = 6.7;
  25.             string stringTal = "55";
  26.  
  27.             doubleTal = floatTal;
  28.  
  29.             floatTal = (float) doubleTal;
  30.  
  31.             intTal = (int) doubleTal;
  32.  
  33.         }
  34.  
  35.         private void button2_Click(object sender, EventArgs e)
  36.         {
  37.             int alder = int.Parse(textBox1.Text);
  38.             alder = alder + 1;
  39.             label1.Text = alder.ToString();
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment