using System;
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine(Math.Round(6.5));
Console.WriteLine(Math.Round(11.5));
}
}
using System;
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine(Math.Round(6.5));
Console.WriteLine(Math.Round(11.5));
}
}
Correct!
Wrong!
using System;
public class Program
{
public static void Main(string[] args)
{
int[] i = new int[0];
Console.WriteLine(i[0]);
}
}
using System;
public class Program
{
public static void Main(string[] args)
{
int[] i = new int[0];
Console.WriteLine(i[0]);
}
}
Correct!
Wrong!
using System;
public class Program
{
public static void Main(string[] args)
{
byte sayi= 100;
dynamic deger= sayi;
Console.WriteLine(val.GetType());
deger+= 100;
Console.WriteLine(val.GetType());
}
}
using System;
public class Program
{
public static void Main(string[] args)
{
byte sayi= 100;
dynamic deger= sayi;
Console.WriteLine(val.GetType());
deger+= 100;
Console.WriteLine(val.GetType());
}
}
Correct!
Wrong!
using System;
public class Program
{
public static void Main(string[] args)
{
#if (!pi)
Console.WriteLine("i");
#else
Console.WriteLine("PI değeri tanımsız");
#endif
Console.WriteLine("ok");
Console.ReadLine();
}
}
using System;
public class Program
{
public static void Main(string[] args)
{
#if (!pi)
Console.WriteLine("i");
#else
Console.WriteLine("PI değeri tanımsız");
#endif
Console.WriteLine("ok");
Console.ReadLine();
}
}
Correct!
Wrong!
using System;
public class Program
{
public static void Main(string[] args)
{
int[] arr = new int[2];
arr[1] = 10;
Object o = arr;
int[] arr1 = (int[])o;
arr1[1] = 100;
Console.WriteLine(arr[1]);
((int[])o)[1] = 1000;
Console.WriteLine(arr[1]);
}
}
using System;
public class Program
{
public static void Main(string[] args)
{
int[] arr = new int[2];
arr[1] = 10;
Object o = arr;
int[] arr1 = (int[])o;
arr1[1] = 100;
Console.WriteLine(arr[1]);
((int[])o)[1] = 1000;
Console.WriteLine(arr[1]);
}
}
Correct!
Wrong!
using System;
public class Program
{
public static void Main(string[] args)
{
String a = "Bilişim Ögretmeni";
String b = "BİLİŞİM ÖĞRETMENİ";
int c;
c = a.CompareTo(b);
Console.WriteLine(c);
}
}
using System;
public class Program
{
public static void Main(string[] args)
{
String a = "Bilişim Ögretmeni";
String b = "BİLİŞİM ÖĞRETMENİ";
int c;
c = a.CompareTo(b);
Console.WriteLine(c);
}
}
Correct!
Wrong!
using System;
public class Program
{
static void arrayMethod(int[] a)
{
int[] b = new int[5];
a = b;
}
public static void Main(string[] args)
{
int[] arr = new int[10];
arrayMethod(arr);
Console.WriteLine(arr.Length);
}
}
using System;
public class Program
{
static void arrayMethod(int[] a)
{
int[] b = new int[5];
a = b;
}
public static void Main(string[] args)
{
int[] arr = new int[10];
arrayMethod(arr);
Console.WriteLine(arr.Length);
}
}
Correct!
Wrong!
using System;
public class Program
{
public static void Main(string[] args)
{
Program p = new Program();
p.print(2, 3, 8);
int[] arr = { 2, 11, 15, 20 };
p.print(arr);
Console.ReadLine();
}
public void print(params int[] b)
{
foreach (int i in b)
{
Console.WriteLine(i);
}
}
}
using System;
public class Program
{
public static void Main(string[] args)
{
Program p = new Program();
p.print(2, 3, 8);
int[] arr = { 2, 11, 15, 20 };
p.print(arr);
Console.ReadLine();
}
public void print(params int[] b)
{
foreach (int i in b)
{
Console.WriteLine(i);
}
}
}
Correct!
Wrong!
using System;
public class Program
{
public static void Main(string[] args)
{
char x = 'A';
int i = 0;
Console.WriteLine (true ? x : 0);
Console.WriteLine(false ? i : x);
}
}
using System;
public class Program
{
public static void Main(string[] args)
{
char x = 'A';
int i = 0;
Console.WriteLine (true ? x : 0);
Console.WriteLine(false ? i : x);
}
}
Correct!
Wrong!
using System;
public class Program
{
public static void Main(string[] args)
{
int sayi1= 20;
int sayi2= 30;
sayi1 ^= sayi2^= sayi1^= sayi2;
Console.WriteLine(sayi1+ ","+ sayi2);
}
}
using System;
public class Program
{
public static void Main(string[] args)
{
int sayi1= 20;
int sayi2= 30;
sayi1 ^= sayi2^= sayi1^= sayi2;
Console.WriteLine(sayi1+ ","+ sayi2);
}
}
Correct!
Wrong!
using System;
public class Program
{
public static void Main(string[] args)
{
char[] num = { '1', '2', '3' };
Console.WriteLine(" char array: " + num);
}
}
using System;
public class Program
{
public static void Main(string[] args)
{
char[] num = { '1', '2', '3' };
Console.WriteLine(" char array: " + num);
}
}
Correct!
Wrong!
using System;
public class Program
{
public static void Main(string[] args)
{
Program obj = null;
Console.WriteLine(Program.print());
}
private static String print()
{
return "Merhaba, www.bilisimogretmeni.com :)";
}
}
using System;
public class Program
{
public static void Main(string[] args)
{
Program obj = null;
Console.WriteLine(Program.print());
}
private static String print()
{
return "Merhaba, www.bilisimogretmeni.com :)";
}
}
Correct!
Wrong!
using System;
using System.Collections.Generic;
public class Program
{
public static void Main(string[] args)
{
string[] strings = { "abc", "def", "ghi" };
var actions = new List();
foreach (string str in strings)
actions.Add(() => { Console.WriteLine(str); });
foreach (var action in actions)
action();
}
}
using System;
using System.Collections.Generic;
public class Program
{
public static void Main(string[] args)
{
string[] strings = { "abc", "def", "ghi" };
var actions = new List();
foreach (string str in strings)
actions.Add(() => { Console.WriteLine(str); });
foreach (var action in actions)
action();
}
}
Correct!
Wrong!
using System;
using System.Collections.Generic;
public class Program
{
public static void Main(string[] args)
{
var actions = new List();
for (int i = 0; i Console.WriteLine(i));
foreach (var action in actions)
action();
}
}
using System;
using System.Collections.Generic;
public class Program
{
public static void Main(string[] args)
{
var actions = new List();
for (int i = 0; i Console.WriteLine(i));
foreach (var action in actions)
action();
}
}
Correct!
Wrong!
using System;
using System.Collections.Generic;
namespace TechBeamers
{
delegate string del(string str);
class sample
{
public static string DelegateSample(string a)
{
return a.Replace(',', '*');
}
}
public class InterviewProgram
{
public static void Main(string[] args)
{
del str1 = new del(sample.DelegateSample);
string str = str1("Merhaba,,arkadaşlar,,test,,Zormu");
Console.WriteLine(str);
}
}
}
using System;
using System.Collections.Generic;
namespace TechBeamers
{
delegate string del(string str);
class sample
{
public static string DelegateSample(string a)
{
return a.Replace(',', '*');
}
}
public class InterviewProgram
{
public static void Main(string[] args)
{
del str1 = new del(sample.DelegateSample);
string str = str1("Merhaba,,arkadaşlar,,test,,Zormu");
Console.WriteLine(str);
}
}
}
Correct!
Wrong!
C# Online Test 2
Sonuç hiç iç açıcı değil konuları tekrar etmende fayda var
Bazı konularda eksiğin var tamamlan gerek
Tebrikler, :) iyi bir programcı olma yolunda ilerliyorsun
Share your Results: