0
An Array in a C program
write a c program that inserts a 6 floating numbers in an array and an integer in a variable, then the program multiply each cell of the array by the integer then store the result in the corresponding cell..
1 Answer
+ 9
int main(){
int a, i;
float arr[6];
printf("insert an integer: ");
scanf("%d", &a);
// insert the elements of the array
for(i=0; i<6; i++){
printf("insert value of arr[%d] = ", i);
scanf("%f", arr[i]);
}
// multiply each cell of the array by a
for(i=0; i<6; i++){
arr[i] *= a;
}
}