Advertisement
AalborgHTX

Cast mellem taltyper

Dec 10th, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 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 WindowsFormsApp10
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void btnKlik_Click(object sender, EventArgs e)
  21.         {
  22.             float tal1 = 5.5f;
  23.             double tal2 = 5.75;
  24.             int tal3 = 7;
  25.  
  26.             //tal2 = tal1 + tal3;
  27.  
  28.             tal3 = (int) tal1 + (int) tal2;
  29.             MessageBox.Show(tal3.ToString());
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement