hey i have a programming problem and i am unsure of what the final part is.
the question is:
Write a program that fills an array with 10 random numbers between 1 and 20, displays the 10 numbers, and finds the sum of the 10 numbers. Call the getData, displayData, and getSum functions from the main function. Output the sum from the main program by calling the getSum function within a printf statement.
i am just really unsure of what this is--
getData, displayData, and getSum functions from the main function. Output the sum from the main program by calling the getSum function within a printf statement.
what i have got so far is;
Code:
#include <stdio.h>
#include <stdlib.h>
#define ARY_SIZE 10
int main()
{
int randomNumbers[ARY_SIZE], sum = 0, i;
srand (time(NULL));
for(i = 0; i < ARY_SIZE; i++)
{
randomNumbers[i] = (rand() % ARY_SIZE) + 1;
//printf("%d\n", randomNumbers[i]);
}
printf("\n");
for(i = 0; i < ARY_SIZE; i++)
{
sum = sum + randomNumbers[i];
}
//printf("%d", sum);
return 0;
}