- #1
doktorwho
- 181
- 6
Homework Statement
I am fairly new to C programming. I need to write a code that creates an array of max 300 numbers, ask the user to input the numbers and then print that array.
Homework Equations
3. The Attempt at a Solution [/B]
Here is my code
C:
#include <stdio.h>
void main() {
int numbers[300];
int i, n;
printf("Enter the size of your array: \n");
scanf("%d", &n);
printf("Enter the numbers: \n");
for (i = 0; i < n; ++i);
scanf("%d", &numbers[i]);
printf("Now your array will be printed: \n");
for (i = 0; i < n; ++i);
printf("%d ", numbers[i]);
return 0;
}