السلام عليكم ورحمة الله وبركاته
الدرس الثاني :
Code calculates the average
الوصف:
كود يقوم بحساب المتوسط الحسابي لثلاثة ارقام صحيحه
الدرس الثاني :
Code calculates the average
الوصف:
كود يقوم بحساب المتوسط الحسابي لثلاثة ارقام صحيحه
- الكود:
int a;
int b;
int c;
int sum;
int average;
Console.WriteLine("enter the frist number ");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("enter the frist number ");
b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("enter the frist number ");
c = Convert.ToInt32(Console.ReadLine());
sum = a + b + c;
average=sum/3;
Console.WriteLine("average is {0},sum is {1}",average,sum);