Write a program in java and do the following :-
● Input in a double dimension array about each participant of elections :- how much votes got, how many seats they won, who won from which state, and which is the majority party.
● Display the name of the candidate who won, the no. of votes he won and with how many seats he won
● Also display which candidate in the constituent assembly has tge highest margin of winning
● And by how many votes he won from the other parties
Answers
Answered by
0
Input: array[4][4] = { {1, 1, 1, 1},
{2, 2, 2, 2},
{3, 3, 3, 3},
{4, 4, 4, 4}};
Output: Sum of the 0 row is = 4
Sum of the 1 row is = 8
Sum of the 2 row is = 12
Sum of the 3 row is = 16
Sum of the 0 column is = 10
Sum of the 1 column is = 10
Sum of the 2 column is = 10
Sum of the 3 column is = 10
Approach:
The sum of each row and each column can be calculated by traversing through the matrix and adding up the elements.
ho
Similar questions