Question
*******REPOSTING BECAUSE I AM STILL GETTING THE SAME ERRORS******* Hello, I posted this question once before and got an answer, however whenever I save the
*******REPOSTING BECAUSE I AM STILL GETTING THE SAME ERRORS*******
Hello, I posted this question once before and got an answer, however whenever I save the file as a .c source file (the format I need to submit this in) I am still running into the same errors when I compile and run the code. Below, I am posting my original solution, the assignment requirements, and the errors from the C compiler that I keep getting.
PLEASE KEEP THE CODE TO C ONLY AS I HAVE TO SAVE IT AS A .C SOURCE FILE.
Thanks in advance !
ASSIGNMENT REQUIREMENTS:
Create a c program . the client needs a simple program that will store the results of up to 10,000 sale transaction amounts. The program should randomly populate a random number of sales.
the program should randomly populate a random number of sales. between 500-10,000
example run your program generates the random number 666. this random number will represent the esize for your array.
Next you will loop ezise times. within each loop. you will generate a new random number (you decide the domain of the values.) you will store each of the random values in your array
199
678
228
122
874
389
159
output the values within the array in columns of 10 numbers in each column (other than the last column it will have 10 or less values)
Also calculate and display the following:
Largest number
smallest number
average of the number
Format the columns so they come out neatly!
MY ORIGINAL SOLUTION:
#include
int main() { srand(time(NULL)); int arr[10000]; int sales=(rand()%(10000-500+1))+500; printf("The number of sales :%d ",sales); printf(" "); for(int i=0;i
ERRORS FROM THE COMPILER WHEN I SAVE IT AS A .C SOURCE FILE:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started