30 Kasım 2017 Perşembe

yazlım tarafında data tiplerini çevirme

2 farklı çeviri yöntemi bulunmakta

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace App3
{
    class Program
    {
        static void Main(string[] args)
        {
            string StrVar = "Karani";
            int IntVar = 153;
            double DoubleVar = 10,50;
            bool BoolVar = true;

            string XToStr1 = IntVar.ToString();
            string XToStr2 = Convert.ToString(IntVar);

            Console.WriteLine(XToStr1);
            Console.WriteLine(XToStr2);

            Console.WriteLine();



            Console.ReadLine();

          
        }
    }
}
-------------------------------------------------------------


 string XToStr1 = IntVar.ToString();
            string XToStr2 = Convert.ToString(IntVar);
            int StrToInt1 = Convert.ToInt32(StrVar);

            Console.WriteLine(XToStr1);
            Console.WriteLine(XToStr2);
            Console.WriteLine(StrToInt1);

 -----------------------------------------------------------------------

double interger çevirme

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace App3
{
    class Program
    {
        static void Main(string[] args)
        {
            string StrVar = "Karani";
            int IntVar = 153;
            double DoubleVar = 10,50;
            bool BoolVar = true;

            string XToStr1 = IntVar.ToString();
            string XToStr2 = Convert.ToString(IntVar);
            int StrToInt1 = Convert.ToInt32(StrVar);

            int DoubleToInt1 = (int)DoubleVar;
            int DoubleToInt2 = Convert.ToInt32(DoubleVar);


            Console.WriteLine(XToStr1);
            Console.WriteLine(XToStr2);
            Console.WriteLine(StrToInt1);
            Console.WriteLine(DoubleToInt1);
            Console.WriteLine(DoubleToInt2);






            Console.ReadLine();

           
        }
    }
}
 

-------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace App3
{
    class Program
    {
        static void Main(string[] args)
        {

            string StrVar = "16500";
            string StrDoubleVar = "16,500";
            int IntVar = 156;
            double DoubleVar = 10.99;
                                                      

            string XToStr1 = IntVar.ToString();
            string XToStr2 = Convert.ToString(IntVar);

            int StrToInt1 = Convert.ToInt32(StrVar);

            int DoubleToInt1 = (int)DoubleVar;
            int DoubleToInt2 = Convert.ToInt32(DoubleVar);

            double StrToDouble1 = Convert.ToDouble(StrDoubleVar);


            Console.WriteLine(XToStr1);
            Console.WriteLine(XToStr2);
            Console.WriteLine(StrToInt1);
            Console.WriteLine(DoubleToInt1);
            Console.WriteLine(DoubleToInt2);
            Console.WriteLine(StrToDouble1);







            Console.ReadLine();

           
        }
    }
}


Hiç yorum yok:

Yorum Gönder

Yapay Zeka üst model alt model, efor hakkında

 Yapay Zeka üst model alt model hangisi ne iş yapar nasıl karar alır ile ilgili sade net bilgileri içeren bilgi notu sayfası: 1. örnek: Büyü...