Hi, i have an assignment to do that is: Write a program that asks the users to enter a value for array size “n” and fill up the array with n integers. Then reverse the array and print it on the screen.
I am not asking for the whole thing to be done for me, but I need help with getting the user to enter the array size. I have this so far
Code:
#include <stdio.h>
int main(void)
{
int n;
printf("Enter size of array\n");
scanf_s("%d", &n);
float array[n];
for (int i = 0; i < n; i++) {
scanf_s("%f", &array[n]);
}
printf("%f", array[n]);
getchar();
getchar();
}