C
xxxxxxxxxx
int main() {
int n, i;
float num[100], sum = 0.0, avg;
printf("Enter the numbers of elements: ");
scanf("%d", &n);
while (n > 100 || n < 1) {
printf("Error! number should in range of (1 to 100).\n");
printf("Enter the number again: ");
scanf("%d", &n);
}
for (i = 0; i < n; ++i) {
printf("%d. Enter number: ", i + 1);
scanf("%f", &num[i]);
sum += num[i];
}
avg = sum / n;
printf("Average = %.2f", avg);
return 0;
}
Enter the numbers of elements: 6 1. Enter number: 45.3 2. Enter number: 67.5 3. Enter number: -45.6 4. Enter number: 20.34 5. Enter number: 33 6. Enter number: 45.6 Average = 27.69
Linux - كيفية تثبيت anc-api-tools
Linux - كيفية تثبيت curvedns
Python - تحقق مما إذا كان الرقم موجبًا أم سالبًا أم 0
Linux - كيفية تثبيت zenmap
C - عد عدد الأرقام في عدد صحيح
JavaScript - تحقق مما إذا كانت السلسلة تبدأ وتنتهي بأحرف معينة
C++ - تحقق مما إذا كان الرقم أوليًا أم لا
C - ابحث عن أكبر رقم باستخدام تخصيص الذاكرة الديناميكي
Kotlin - تقريب رقم إلى n منازل عشرية
C++ - تحقق من السنة الكبيسة
Kotlin - عكس رقم
Java - عكس رقم
Linux - كيفية تثبيت zstd
Linux - كيفية تثبيت zfs-test
Kotlin - أوجد عاملي العدد
Linux - كيفية تثبيت xbitmaps
Python - كتابة ملفات إكسل (XLSX)
Java - إنشاء الهرم والنمط
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month