Bu İki Kod Arasındaki Farkı Bana Söliyebilirmisiniz Acil !!
using System; namespace Operatorler { class DortIslem { static void Main(string[] args) { int x = 10; int y = 5; Console.WriteLine("x + y = {0}", x + y); Console.WriteLine("x - y = {0}", x - y); Console.WriteLine("x * y = {0}", x * y); Console.WriteLine("x / y = {0}", x / y); Console.ReadKey(); } } }
using System; namespace Operatorler { class DortIslem { static void Main(string[] args) { int x = 10; int y = 4; int intSonuc = x / y; float floatSonuc = x / y; double doubleSonuc = x / y; Console.WriteLine("x / y = {0}", intSonuc); Console.WriteLine("x / y = {0}", floatSonuc); Console.WriteLine("x / y = {0}", doubleSonuc); Console.ReadKey(); } } }
DH forumlarında vakit geçirmekten keyif alıyor gibisin ancak giriş yapmadığını görüyoruz.
Üye olduğunda özel mesaj gönderebilir, beğendiğin konuları favorilerine ekleyip takibe alabilir ve daha önce gezdiğin konulara hızlıca erişebilirsin.
Fark yok müdür 1.kod 4 işlem yapıyo 2.kod sadece bölme.
Edit aradığın şey bu sanırım,böyle olursa intte sonuc 2 cıkar doubleda 2,5 float'tada 2,5 cıkar:
int x = 10; int y = 4; int intSonuc = x / y; float floatSonuc = (float)x / (float)y; double doubleSonuc = (double)x / (double)y; Console.WriteLine("x / y = {0}", intSonuc); Console.WriteLine("x / y = {0}", floatSonuc); Console.WriteLine("x / y = {0}", doubleSonuc); Console.ReadKey();
using System;
namespace Operatorler
{
class DortIslem
{
static void Main(string[] args)
{
int x = 10;
int y = 5;
Console.WriteLine("x + y = {0}", x + y);
Console.WriteLine("x - y = {0}", x - y);
Console.WriteLine("x * y = {0}", x * y);
Console.WriteLine("x / y = {0}", x / y);
Console.ReadKey();
}
}
}
******************************************************************************************************************
using System;
namespace Operatorler
{
class DortIslem
{
static void Main(string[] args)
{
int x = 10;
int y = 4;
int intSonuc = x / y;
float floatSonuc = x / y;
double doubleSonuc = x / y;
Console.WriteLine("x / y = {0}", intSonuc);
Console.WriteLine("x / y = {0}", floatSonuc);
Console.WriteLine("x / y = {0}", doubleSonuc);
Console.ReadKey();
}
}
}
DH forumlarında vakit geçirmekten keyif alıyor gibisin ancak giriş yapmadığını görüyoruz.
Üye Ol Şimdi DeğilÜye olduğunda özel mesaj gönderebilir, beğendiğin konuları favorilerine ekleyip takibe alabilir ve daha önce gezdiğin konulara hızlıca erişebilirsin.
< Bu mesaj bu kişi tarafından değiştirildi ManyaKuu -- 21 Aralık 2012; 10:49:21 >