اكتب برنامج C لقراءة مصفوفة طولها 5 وطباعة موضع وقيمة عناصر المصفوفة ذات القيمة الأقل من 5
- برمجة
- برمجة سي c
- 2021-05-02
- Wassim
الأجوبة
/*Write a C program to read an array of length 5 and print the position and value of the array elements of value less than 5*/
#include <stdio.h>
#define AL 5
#define MAX 5
int main() {
float N[AL];
int i;
printf("Input the 5 members of the array:\n");
for(i = 0; i < AL; i++) {
scanf("%f", &N[i]);
}
for(i = 0; i < AL; i++) {
if(N[i] < MAX) {
printf("A[%d] = %.1f\n", i, N[i]);
}
}
return 0;
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال