You are on page 1of 3

Stander Code C#

//Print output ‫كتابة األمر كله مره واحده‬


Console.WriteLine("Hello World!");
//Print output ‫على أسطر متعدد ولكن النتيجة سطر واحد‬ ‫كتابة األمر‬
Console.Write("Congratulations!");
Console.Write(" ");
Console.Write("You wrote your first lines of ode!");
/* ‫مثال على النوعين اإلدخال‬
1-
Console.WriteLine("This is the first line.");
‫ناتج األمر األول‬
This is the first line.
2-
Console.Write("This is ");
Console.Write("the second ");
Console.Write("line.");
‫ناتج األمر الثاني‬
This is the second line.
Code
Console.WriteLine("a" == "a");
Console.WriteLine("a" == "A");
Console.WriteLine(1 == 2);

string myValue = "a";


Console.WriteLine(myValue == "a");

Output
True
False
False
True
code
Console.WriteLine("a" != "a");
Console.WriteLine("a" != "A");
Console.WriteLine(1 != 2);

string myValue = "a";


Console.WriteLine(myValue != "a");
Output
False
True
True
False
Code
Console.WriteLine(1 > 2);
Console.WriteLine(1 < 2);
Console.WriteLine(1 >= 1);
Console.WriteLine(1 <= 1);
Output
False
True
True
True
 int for most whole numbers
 decimal for numbers representing money
 bool for true or false values
 string for alphanumeric value
 Choose specialty complex types for special situations. Don't
reinvent data types if they already exist for a given purpose.
 byte for working with encoded data that comes from other
computer systems or using different character sets.
 double for working with geometric or scientific purposes.
double is used frequently when building games involving
motion.
 System.StringBuilder to build a single string from many
literals or other variables. We'll cover this in more detail in the
Modify content of strings using built-in string data type methods
in C# module.
 System.DateTime for a specific date and time value.
 System.TimeSpan for a span of years /months /days
/hours /minutes /seconds/milliseconds.

You might also like