0% found this document useful (0 votes)
8 views12 pages

Code

Uploaded by

cetinderedusty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views12 pages

Code

Uploaded by

cetinderedusty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

namespace Deneme1

{
class Sample
{ // tür dönüşümü
public static void Main(string[] args)
{
int a = 20;
double b;

b = a;
System.Console.WriteLine(b);
}

}
}

//////////////////////////////////////
/////////////////////////////////////////
namespace Deneme1
{
class Sample
{ // tür dönüşümü
public static void Main(string[] args)
{
byte a, b;
byte result;

a = 10;
b = 20;
result = a + b; // error

System.Console.WriteLine("a = {0}\nb = {1}", a, b);


System.Console.WriteLine("result", result);

}
}

//////////////////////////////////////
/////////////////////////////////////////
namespace Deneme1
{
class Sample
{ // tür dönüşümü
public static void Main(string[] args)
{
byte a, b;
byte result;

a = 10; /// >>> 0000 1010


b = 20; /// >>> 0001 0100
result = a + b; // error >>> 0001 1110

System.Console.WriteLine("a = {0}\nb = {1}", a, b);


System.Console.WriteLine("result", result);

}
}
}

//////////////////////////////////////
/////////////////////////////////////////
namespace Deneme1
{
class Sample
{ // tür dönüşümü
public static void Main(string[] args)
{
int a = 260;
byte b;

b = a; // Error

System.Console.WriteLine();

}
}

//////////////////////////////////////
/////////////////////////////////////////
namespace Deneme1
{
class Sample
{ // tür dönüşümü
public static void Main(string[] args)
{
int a = 260;
byte b;

b = (byte)a; // 4

System.Console.WriteLine(b);

}
}

//////////////////////////////////////
/////////////////////////////////////////
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
// [isim uzayı ismi][.][sınıf ismi][.]<metot ismi>([argüman listesi]);
Test1.Sample.Foo();
}
/*
[erişim belirteci] [static] <geri dönüş değeri> <metot adı>([parametre
listesi])
{
//...
}
*/

}
}
namespace Test1
{
class Sample
{
public static void Foo()
{
System.Console.WriteLine("Test.Sample.Foo()...");
}
}
}

//////////////////////////////////////
/////////////////////////////////////////
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
// [isim uzayı ismi][.][sınıf ismi][.]<metot ismi>([argüman listesi]);
Test1.Sample.Foo();
Deneme1.Sample2.Foo();
}
/*
[erişim belirteci] [static] <geri dönüş değeri> <metot adı>([parametre
listesi])
{
//...
}
*/

}
class Sample2
{
public static void Foo()
{
System.Console.WriteLine("Deneme1.Sample2.Foo()...");
}
}
}
namespace Test1
{
class Sample
{
public static void Foo()
{
System.Console.WriteLine("Test1.Sample.Foo()...");
}
}
}

//////////////////////////////////////
/////////////////////////////////////////
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
// [isim uzayı ismi][.][sınıf ismi][.]<metot ismi>([argüman listesi]);
Test1.Sample.Foo();
Sample2.Foo();
}
/*
[erişim belirteci] [static] <geri dönüş değeri> <metot adı>([parametre
listesi])
{
//...
}
*/

}
class Sample2
{
public static void Foo()
{
System.Console.WriteLine("Deneme1.Sample2.Foo()...");
}
}
}
namespace Test1
{
class Sample
{
public static void Foo()
{
System.Console.WriteLine("Test1.Sample.Foo()...");
}
}
}

//////////////////////////////////////
/////////////////////////////////////////
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
// [isim uzayı ismi][.][sınıf ismi][.]<metot ismi>([argüman listesi]);
Test1.Sample.Foo();
Sample2.Foo();
Foo();
}
public static void Foo()
{
System.Console.WriteLine("Deneme1.Sample.Foo()...");
}

}
class Sample2
{
public static void Foo()
{
System.Console.WriteLine("Deneme1.Sample2.Foo()...");
}
}
}
namespace Test1
{
class Sample
{
public static void Foo()
{
System.Console.WriteLine("Test1.Sample.Foo()...");
}
}
}

//////////////////////////////////////
/////////////////////////////////////////
using System;
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
// [isim uzayı ismi][.][sınıf ismi][.]<metot ismi>([argüman listesi]);
Test1.Sample.Foo();
Sample2.Foo();
Foo();
}
public static void Foo()
{
Console.WriteLine("Deneme1.Sample.Foo()...");
}

}
class Sample2
{
public static void Foo()
{
Console.WriteLine("Deneme1.Sample2.Foo()...");
}
}
}
namespace Test1
{
class Sample
{
public static void Foo()
{
Console.WriteLine("Test1.Sample.Foo()...");
}
}
}

//////////////////////////////////////
/////////////////////////////////////////
using System;
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
int a;
{
int b;
b = 10;
a = 20;
Console.WriteLine(a+b);
}
Console.WriteLine(a);
Console.WriteLine(a + b); // error
}
public static void Foo()
{
Console.WriteLine("Deneme1.Sample.Foo()...");
}

}
class Sample2
{
public static void Foo()
{
Console.WriteLine("Deneme1.Sample2.Foo()...");
}
}
}
namespace Test1
{
class Sample
{
public static void Foo(int a)
{
Console.WriteLine("Test1.Sample.Foo()...");
}
}
}

//////////////////////////////////////
/////////////////////////////////////////
using System;
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
int a, b;
a = 10;
b = 20;
Foo(a, b);

}
public static void Foo(int a, int b)
{
Console.WriteLine("Deneme1.Sample.Foo({0}, {1})...", a, b);
}

}
class Sample2
{
int a;
int b;
static int c;

public static void Foo()


{
Console.WriteLine("Deneme1.Sample2.Foo()...");
}
}
}
namespace Test1
{
class Sample
{
public static void Foo(int a)
{
Console.WriteLine("Test1.Sample.Foo()...");
}
}
}

//////////////////////////////////////
/////////////////////////////////////////
using System;
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
int a;
double b;
a = 10;
b = 20.0;
Foo(a, b);

}
public static void Foo(int a, double b)
{
Console.WriteLine("Deneme1.Sample.Foo({0}, {1})...", a, b);
}

}
class Sample2
{
int a;
int b;
static int c;

public static void Foo()


{
Console.WriteLine("Deneme1.Sample2.Foo()...");
}
}
}
namespace Test1
{
class Sample
{
public static void Foo(int a)
{
Console.WriteLine("Test1.Sample.Foo()...");
}
}
}

//////////////////////////////////////
/////////////////////////////////////////
using System;
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
Sample2.Foo();
Sample2.Foo(10); // # 2
Sample2.Foo(10, 20); // # 4
Sample2.Foo(10.2, 20);

}
class Sample2
{
public static void Foo() // # 1
{
Console.WriteLine("Deneme1.Sample2.Foo()");
}
public static void Foo(int a) // # 2
{
Console.WriteLine("Deneme1.Sample2.Foo(int)");
}
public static void Bar(int a) // # 3
{
Console.WriteLine("Deneme1.Sample2.Bar(int)");
}
public static void Foo(int a, int b) // # 4
{
Console.WriteLine("Deneme1.Sample2.Foo(int, int)");
}
public static void Foo(int a, double b) // # 5
{
Console.WriteLine("Deneme1.Sample2.Foo(int, double)");
}
public static void Foo(short a, double b) // # 6
{
Console.WriteLine("Deneme1.Sample2.Foo(short, double)");
}
public static void Foo(double a, double b) // # 7
{
Console.WriteLine("Deneme1.Sample2.Foo(double, double)");
}
public static void Foo(float a, int b) // # 8
{
Console.WriteLine("Deneme1.Sample2.Foo(float, int)");
}
public static void Bar(int a, double b) // # 9
{
Console.WriteLine("Deneme1.Sample2.Bar(int, double)");
}
}
}

//////////////////////////////////////
/////////////////////////////////////////
using System;
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
int result;
result = Sum(10, 20);
Console.WriteLine("Toplam = {0}", result);

public static int Sum(int a, int b)


{
return a + b;
}
}
}

//////////////////////////////////////
/////////////////////////////////////////
using System;
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
int val, result;
Console.Write("Sayı girişi : ");
val = int.Parse(Console.ReadLine());

result = Kare(val);
Console.WriteLine("Toplam = {0}", result);

public static int Kare(int a)


{
return a * a;
}
}
}

//////////////////////////////////////
/////////////////////////////////////////
using System;
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
int val, result;
Console.Write("Sayi girişi : ");
val = int.Parse(Console.ReadLine());

result = Faktoriyel(val);

Console.WriteLine("Sonuç = {0}", result);

/*
if (<boolean değer>)
//... >>> true
else
//... >>> false
*/
}

public static int Faktoriyel(int val)


{
if (val == 0 || val == 1)
return 1;
return val * Faktoriyel(val -1);
}

}
}
/*
sayi = 5
sayi * (sayi - 1)!
5! = 5 * 4 * 3 * 2 * 1
5! = 5 * 4!
4! = 4 * 3!
3! = 3 * 2!
2! = 2 * 1!
1! = 1
0! = 1
*/

//////////////////////////////////////
/////////////////////////////////////////
using System;
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
double val, result;
Console.Write("Sayi girişi : ");
val = double.Parse(Console.ReadLine());

result = Math.Sqrt(val);
Console.WriteLine("Sonuç = {0}", result);
}

}
}

//////////////////////////////////////
/////////////////////////////////////////
using System;
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
double val, kuvvet, result;
Console.Write("Sayi girişi : ");
val = double.Parse(Console.ReadLine());
Console.Write("Kuvvet : ");
kuvvet = double.Parse(Console.ReadLine());

result = Math.Pow(val, kuvvet);


Console.WriteLine("Sonuç = {0}", result);
}

}
}

//////////////////////////////////////
/////////////////////////////////////////
using System;
namespace Deneme1
{
class Sample
{
public static void Main(string[] args)
{
double val, kuvvet, result;
Console.Write("Sayi girişi : ");
val = double.Parse(Console.ReadLine());
Console.Write("Kuvvet : ");
kuvvet = double.Parse(Console.ReadLine());

result = Math.Pow(val, kuvvet);


Console.WriteLine("Sonuç = {0}", result);
}
public static double MyPow(double a, double b)
{
//...
}
public static double MySqrt(double a, double b)
{
//...
}
// https://tr.wikipedia.org/wiki/E_say%C4%B1s%C4%B1
// 4. eşitliktekş diziye göre hesaplanacak
GetE(int 20)
{
// ...
}
}
}

//////////////////////////////////////
/////////////////////////////////////////

You might also like