بدايه مبرمج
2.15K subscribers
77 photos
153 files
262 links
طريقك الى عالم البرمجه😍
حيث 1+1 لايساوي 2

💫أول قناه تستهدف الطلاب المبدئين وتبدا بالشروحات من الصفر...
Download Telegram
إ₰...👨🏻‍💻..👩🏻‍💻...₰❥

لقراءة المعطيات الرقمية استخدم الكود التالي:
Console.Write ("Your Age Please: ");
int age = int.Parse(Console.ReadLine( ));

#OR_use....

int age = Convert.Toint32 (Console.ReadLine( ));
Console.Write ("Your Age is " + age);


#اولآ : بإمكانك تحويل العبارات النصية التي يقرأها هذا الامر إلى نوع آخر وذلك باستخدام الفئة Convert...

string s = Console.ReadLine();

1- int i = Convert.ToInt32(s);
//convert to int..

2- long l = Convert.ToInt64(s);
// convert to long..


3- float f = Convert.ToSingle(s);
// convert to float..


4- double d =
Convert.ToDouble(s);
// convert to double..


5- decimal c =
Convert.ToDecimal(s);
// convert to decimal..


#ثانيآ : كما يمكن استخدام الطريقة Parse:

1- Long A = Int64.Parse(s)
// convert to long..

2- float A = Single.Parse(s)
// convert to float..

3- Decimal A = Decimal.Parse(s)
// convert to decimal..

4- double A = double.Parse(s)
// convert to double..

4- int A = int.Parse(s)
// convert to int..

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
•┈┈┈•❈••✦✾✦••❈•┈┈┈•