Question
IN C programming The results from the mayors race have been reported by each precinct as follows: Candicate Candicate Candicate Candicate Precint A B C
IN C programming
The results from the mayors race have been reported by each precinct as follows:
Candicate Candicate Candicate Candicate
Precint A B C D
1 192 48 206 37
2 147 90 312 21
3 186 12 121 38
4 114 21 408 39
Write a program to do the following:
1.) Use symbolic constants
#define PRECINTS 4
#define CANDIDATES 4
2 .) Display the table with appropriate labels for the rows and columns.
3.) Call a function
void printArray(const int votes[][CANDIDATS], int precints, int cands)
to display the votes of each candidate in a table. Write this function.
4.) Compute and display the total number of votes received by each candidate and the percentage of the total votes cast.
5.) If any one candidate received over 50 percent of the votes, the program should display a message declaring that candidate the winner.
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