Professional Documents
Culture Documents
Data structure
Queue graph
What’s Algorithm?
It’s a logical sequence of direct steps that describe a solution to a given problem in a finite amount of
time.
It’s a finite set of instructions or logic, written in order to perform a certain predefined task.
Variables:
Variables
Types
Floating
Integers strings Boolean
points
short double
string
(2byte) (8byte)
int (4 byte)
long
(8byte)
<data type > <variable name> ;
Ex:
int radius;
double area;
int a, b,c ;
bool is_okay;
noteC# is case-sensitive
comments:
// single line comment
/*
Multi-line
comment
*/
Output statements:
Console.Write(“welcome”); ھﻨﺎ ﺑﻌﺪ ﻣﯿﻄﺒﻊ ھﯿﻔﻀﻞ اﻟﻤﺆﺷﺮ ﻓﻲ ﻧﻔﺲ اﻟﺴﻄﺮ
Input statements:
Console.ReadLine(); ﺑﺘﺮﺟﻊ ﺑﻨﺺ
string name = Console.ReadLine();
(int, double, float,…….) ﻻﺑﺪ ﻣﻦ ﺗﺤﻮﯾﻠﮫ ﻟﺮﻗﻢ أيstringﻟﻮ اﻟﻤﺴﺘﺨﺪ ھﯿﺪﺧﻞ رﻗﻢ ﺑﺎﻟﺘﺎﻟﻰ اﻟﺮﻗﻢ ھﯿﻜﻮن ﻣﻦ ﻧﻮع
int x = int.Parse(Console.ReadLine()); ﻟﻮ ﻋﺎوز ﺗﺤﻮل اﻟﻨﺺ ﻟﺮﻗﻢ ﺳﻮف ﻧﺴﺘﺨﺪم اﻻﻣﺮ اﻟﺘﺎﻟﻰ
String Format :
string myName = “sally”;