C programming help Write a program that reads a list of integers from the keyboa
ID: 3651232 • Letter: C
Question
C programming helpWrite a program that reads a list of integers from the keyboard and creates the following information:
a. Finds and prints the sum and the average of the integers.
b. Finds and prints the largest and the smallest integer.
c. prints boolean(true or false) if some of them are less than 20
d. prints a boolean(true or false) if all of them are between 30 and 40.
The output should look like this:
The number of integers is: xxxxxxx
The sum is : xxxxxxx
The average is : xxxx.xx
The largest is : xxxxxxx
The smallest is : xxxxxxx
At least one is < 50 : true or false
All between 30 and 40 : true or false
At least one is negative : true or false
We are doing this with C
pleae no arrays, we haven't learned them yet
we have to use ive functions and a main
the functions are:
void addthem(int x, int* sum)
void large_small(int x, int * large, int * small)
void one_less_than(int x, bool* truth1)
void between(int x,bool* truth2)
void negative(int x, bool* truth3).
I'm having trouble figuring how to write the functions
The program must be able to get its values from an unknown file. I don't know how many integers are in this file so we must use the EOF
Explanation / Answer
#include #include int count =1; void addthem(int x, int* sum) { *sum=*sum+x; } void large_small(int x, int * large, int * small) { if(count==1) { *large=x; *small=x; } else { if(x>=*large) *large=x; if(xRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.