0% found this document useful (0 votes)
56 views19 pages

PDF Lab Report

This document is a programming fundamentals lab project report submitted by 4 students to their professor. It details an online voting system project implemented in C code. The report includes an introduction describing the purpose and benefits of online voting systems. It also includes the pseudo code, algorithm, program code, sample output and conclusion.

Uploaded by

Maryam Tariq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views19 pages

PDF Lab Report

This document is a programming fundamentals lab project report submitted by 4 students to their professor. It details an online voting system project implemented in C code. The report includes an introduction describing the purpose and benefits of online voting systems. It also includes the pseudo code, algorithm, program code, sample output and conclusion.

Uploaded by

Maryam Tariq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 19

PROGRAMMING FUNDAMENTALS LAB PROJECT REPORT

DEPARTMENT OF ELECTRICAL ENGINEERING, LCWU

SUBMITTED TO: MS RIMSHA MUSHARRAF

SUBMITTED BY: MUBARRA NAZIR


MARYAM TARIQ
NAYYAB MALIK
MAIDA SHAFIQUE

ROLL NUMBER: 2025115023


2025115022
2025115024
2025115021

SEMESTER: BE-II

SUBJECT: PROGRAMMING FUNDAMENTALS

SESSION: 2020-2024

PROJECT NAME: C Code and Algorithm Online Voting System


Table of Contents

Introduction
Purpose of online voting system
Benefits of online voting system
Pseudo code
Algorithm
Solution
Output
Conclusion
References
ABSTRACT

Online voting system

Online Voting System creates and handles details regarding polling and election
which will enable all citizens to cast their vote via a web-based platform. Database
consisting of records and details of the citizens and candidates who are eligible to
vote are maintained by the system.
Introduction to Online Voting System

An online Voting system is a software platform that allows groups to securely


conduct votes and elections. High quality online voting systems balance ballot
security, accessibility and the overall requirements of an organization’s voting event.
Online Voting System creates and handles details regarding polling and election
which will enable all citizens to cast their vote via a web-based platform. Database
consisting of records and details of the citizens and candidates who are eligible to
vote are maintained by the system.The online voting system makes use of computer
and internet which makes the overall voting procedure easy. It saves time and avoids
errors such as invalid votes and miscalculation of votes. Voting and counting both are
done with the help of a computer, the election process is easy, and this system proves
to be much economical, compared to the manual system.

In online voting system, voting is done online; this process is very easy.Candidates
are first required to fill a form to register themselves, providing various voting-related
details. These entries are then checked by the system database to see if the candidate
fulfills the voting criteria.If the entries are correct and the citizen is eligible to vote, a
user id and password is given to the voter. By using the information provided,
citizens can cast their vote. The vote cast is automatically recorded and checked in
the system database, and can be counted later.
What is the purpose of online voting system?
Online voting tools and online election voting systems help you make important
decisions by gathering the input of your group in a way that’s systematic and
verifiable.

Oftentimes, these decisions are made on a yearly basis during an event or at a


particular time of the year. Or you might run ongoing polls amongst your group (e.g.
anonymous employee feedback surveys).

It’s a good idea to use an online voting system to:

• Elect your leadership: A board of directors election is a good example, where


there are multiple positions (e.g. chair, vice president, secretary, treasurer). All of
which may include supporting documentation (e.g. biographies, resumés,
headshots).
• Admit new members to your group: This helps you stick to a regular, fair
process of evaluation and lets candidates know what to expect.
• Gather anonymous feedback from your employees: Managers (and
managers of managers) want to know how their employees truly feel about their
jobs and work life. Using an online voting system with a capacity for secret
balloting helps employees express their true feelings, by understanding and
trusting that their feedback will be heard, but not tied directly to them.
• Vote on yearly budgets: And since adjustments to your budget are often
needed, an online voting system will keep voting secure and accessible no matter
where the members of your group may happen to be.
• Alter your operational procedures and by laws: Just like leadership
elections, expect group members to react strongly toward changes no matter how
minor to organizational processes. You’ll want to collect individual responses to
these changes in a systematic manner.
In all of these cases, an online voting system will enable better decisions, justify
those decisions, and let you share proof that these decisions were carried out in
line with the standards of your group.
Benefits of online Voting as compared to other voting systems

Online voting allows people in today’s mobile and digitally advanced society to
participate in the democratic process over the internet. The online voting system
offers the highest levels of transparency, control, security and efficiency of election
processes.Online votings provide voters with a comfortable and secure voting
experience and allow election organizers to save resources in planning their next
election.

Online voting is an environmentally friendly and resource-efficient


type of participation: Paper-based votings are both cost-intensive and
burdensome for the environment. One of the benefits of online votings is that they
don’t require many resources: compared to postal elections, online votings reduce
CO2 emissions by 98%.Conduct an environmentally friendly election and save paper,
printing and delivery costs by shifting online. Additionally, save on personel and time
expense and skip the drawn-out manual vote count process by choosing online
votings.
Minimize mistakes: By eliminating the use of physical post and manual vote
counting you can avoid result-distorting mistakes such as loss of voting documents
and miscounted votes. Automatic vote counting with online votings allows you to
access results shortly after the election. Results can also be verified using an external
tool.

Learn more about checking election results: Double-voting and double-


counting of votes are not possible in the POLYAS system. You’ll receive legally valid
election results at a mouse click.

Increase voter turnout with convenient online voting: Voting should be


simple, location-independent and accessible. Reduce barriers to participation and
offer your eligible voters secure online voting in order to boost turnout. Adding the
option to vote online allows eligible voters to cast their votes at any time within the
election period and from any location.

Election marketing at a mouse click: Offer a comfortable, barrier-free online


election and engage voters by sending election invitations and reminders by
email.Further engage voters by creating an election website and containing an
overview of all important information relevant to the election. Benefit from the
advantages of online voting!
PSEUDO CODE

• First of all we declare or assign the constants mean candidates names. After
that we declare vote count for every candidate for vote casting then we print
our constants mean no. Of candidates by name.
• After that we use switch and break command for vote selection.
• Then we print our vote which select by using switch command.
• To get leading candidate in voting we compare every single candidate vote
with all others .
• By using if else statement.
• And then print the leading candidate.
• After that we use do and switch statement to make the options of :
Caste the vote
Find vote counts
Get leading candidate
Exit
After that we print these options
• And at last we use getchar()
• And end our program

ALGORITHM
STEP#1:
Declare or assign the candidates names.

STEP#2:
Declare vote count for every candidate for vote casting then we print
no. Of candidates by name.

STEP#3:
We use switch and break command for vote selection.

STEP#4:
Print our vote which select by using switch command.

STEP#5:
To get leading candidate in voting we compare every single candidate
vote with all others .

STEP#6:
By using if else statement.
STEP#7:
Print the leading candidate.

STEP#8:
Use do and switch statement to make the options of :

STEP#9:
Caste the vote

STEP#10:
Find vote counts

STEP#11:
Get leading candidate

STEP#12:
Exit

STEP#13:
Print these option

STEP#14:
At last we use getchar()

STEP#15:
End

PROGRAM CODE

#include<stdio.h>

#define CANDIDATE_COUNT

#define CANDIDATE1 "Ali Raza"


#define CANDIDATE2 "Bushra Amin"
#define CANDIDATE3 "Ahmed Fawad"
#define CANDIDATE4 "Fakhar Alam"
#define CANDIDATE5 "Salahudin Abrar"
#define CANDIDATE6 "Babar Azam"
#define CANDIDATE7 "Rana Aslam"
#define CANDIDATE8 "Saeed Malik"
#define CANDIDATE9 "Usama Habib"
#define CANDIDATE10 "Mueed sajjad"
#define CANDIDATE11 "Taymoor Akbar"
#define CANDIDATE12 "Saba Rasheed"
#define CANDIDATE13 "Asad Aziz"
#define CANDIDATE14 "Danish Ameer"
#define CANDIDATE15 "Musa Ali"
#define CANDIDATE16 "Raza Ameer"
#define CANDIDATE17 "Fahad Aslam"
#define CANDIDATE18 "Iqra Ameenn"
#define CANDIDATE19 "Daniyal aashir"
#define CANDIDATE20 "Dostar Rana"

int votesCount1=0, votesCount2=0, votesCount3=0, votesCount4=0,votesCount5=0,


votesCount6=0, votesCount7=0, votesCount8=0,
votesCount9=0, votesCount10=0, votesCount11=0, votesCount12=0,
votesCount13=0, votesCount14=0, votesCount15=0, votesCount16=0,
votesCount17=0, votesCount18=0,votesCount19=0, votesCount20=0,
Spoiledvotes=0;
void castVote(){
int choice;
printf("\n\n ### Please choose your Candidate ####\n\n");
printf("\n 1. %s", CANDIDATE1);
printf("\n 2. %s", CANDIDATE2);
printf("\n 3. %s", CANDIDATE3);
printf("\n 4. %s", CANDIDATE4);
printf("\n 5. %s", CANDIDATE5);
printf("\n 6. %s", CANDIDATE6);
printf("\n 7. %s", CANDIDATE7);
printf("\n 8. %s", CANDIDATE8);
printf("\n 9. %s", CANDIDATE9);
printf("\n 10. %s", CANDIDATE10);
printf("\n 11. %s", CANDIDATE11);
printf("\n 12. %s", CANDIDATE12);
printf("\n 13. %s", CANDIDATE13);
printf("\n 14. %s", CANDIDATE14);
printf("\n 15. %s", CANDIDATE15);
printf("\n 16. %s", CANDIDATE16);
printf("\n 17. %s", CANDIDATE17);
printf("\n 18. %s", CANDIDATE18);
printf("\n 19. %s", CANDIDATE19);
printf("\n 20. %s", CANDIDATE20);
printf("\n 21. %s", "None of These");
printf("\n\n Input your choice (1 - 20) : ");
scanf("%d",&choice);

switch(choice){
case 1: votesCount1++; break;
case 2: votesCount2++; break;
case 3: votesCount3++; break;
case 4: votesCount4++; break;
case 5: votesCount5++; break;
case 6: votesCount6++; break;
case 7: votesCount7++; break;
case 8: votesCount8++; break;
case 9: votesCount9++; break;
case 10: votesCount10++; break;
case 11: votesCount11++; break;
case 12: votesCount12++; break;
case 13: votesCount13++; break;
case 14: votesCount14++; break;
case 15: votesCount15++; break;
case 16: votesCount16++; break;
case 17: votesCount17++; break;
case 18: votesCount18++; break;
case 19: votesCount19++; break;
case 20: votesCount20++; break;
default: printf("\n Error: Wrong Choice !! Please retry");
//hold the screen
getchar();
}
printf("\n thanks for vote !!");
}

void votesCount(){
printf("\n\n ##### Voting Statics ####");
printf("\n %s - %d ", CANDIDATE1, votesCount1);
printf("\n %s - %d ", CANDIDATE2, votesCount2);
printf("\n %s - %d ", CANDIDATE3, votesCount3);
printf("\n %s - %d ", CANDIDATE4, votesCount4);
printf("\n %s - %d ", CANDIDATE5, votesCount5);
printf("\n %s - %d ", CANDIDATE6, votesCount6);
printf("\n %s - %d ", CANDIDATE7, votesCount7);
printf("\n %s - %d ", CANDIDATE8, votesCount8);
printf("\n %s - %d ", CANDIDATE9, votesCount9);
printf("\n %s - %d ", CANDIDATE10, votesCount10);
printf("\n %s - %d ", CANDIDATE11, votesCount11);
printf("\n %s - %d ", CANDIDATE12, votesCount12);
printf("\n %s - %d ", CANDIDATE13, votesCount13);
printf("\n %s - %d ", CANDIDATE14, votesCount14);
printf("\n %s - %d ", CANDIDATE15, votesCount15);
printf("\n %s - %d ", CANDIDATE16, votesCount16);
printf("\n %s - %d ", CANDIDATE17, votesCount17);
printf("\n %s - %d ", CANDIDATE18, votesCount18);
printf("\n %s - %d ", CANDIDATE19, votesCount19);
printf("\n %s - %d ", CANDIDATE20, votesCount20);
printf("\n %s - %d ", "Spoiled Votes", Spoiledvotes);
}

void getLeadingCandidate(){
printf("\n\n #### Leading Candiate ####\n\n");
if(votesCount1>votesCount2 && votesCount1>votesCount3 && votesCount1
>votesCount4 && votesCount1 >votesCount5 && votesCount1 >votesCount6
&& votesCount1 >votesCount7 && votesCount1 >votesCount8 &&
votesCount1 >votesCount9 && votesCount1 >votesCount10 && votesCount1
>votesCount11
&& votesCount1 >votesCount12 && votesCount1 >votesCount13 &&
votesCount1 >votesCount14 && votesCount1 >votesCount15 && votesCount1
>votesCount16
&& votesCount1 >votesCount17 && votesCount1 >votesCount18 &&
votesCount1 >votesCount19 && votesCount1 >votesCount20)
printf("[%s]",CANDIDATE1);
else if (votesCount2>votesCount3 && votesCount2>votesCount4 &&
votesCount2 >votesCount1 && votesCount2 >votesCount5 && votesCount2
>votesCount6
&& votesCount2 >votesCount7 && votesCount2 >votesCount8 &&
votesCount2 >votesCount9 && votesCount2 >votesCount10 && votesCount2
>votesCount11
&& votesCount2 >votesCount12 && votesCount2 >votesCount13 &&
votesCount2 >votesCount14 && votesCount2 >votesCount15 && votesCount2
>votesCount16
&& votesCount2 >votesCount17 && votesCount2 >votesCount18 &&
votesCount2 >votesCount19 && votesCount2 >votesCount20)
printf("[%s]",CANDIDATE2);
else if(votesCount3>votesCount4 && votesCount3>votesCount2 && votesCount3
>votesCount1 && votesCount3 >votesCount5 && votesCount3 >votesCount6
&& votesCount3 >votesCount7 && votesCount3 >votesCount8 &&
votesCount3 >votesCount9 && votesCount3 >votesCount10 && votesCount3
>votesCount11
&& votesCount3 >votesCount12 && votesCount3 >votesCount13 &&
votesCount3 >votesCount14 && votesCount3 >votesCount15 && votesCount3
>votesCount16
&& votesCount3 >votesCount17 && votesCount3 >votesCount18 &&
votesCount3 >votesCount19 && votesCount3 >votesCount20)
printf("[%s]",CANDIDATE3);
else if(votesCount4>votesCount1 && votesCount4>votesCount2 && votesCount4
>votesCount3 && votesCount4 >votesCount5 && votesCount4 >votesCount6
&& votesCount4 >votesCount7 && votesCount4 >votesCount8 &&
votesCount4 >votesCount9 && votesCount4 >votesCount10 && votesCount4
>votesCount11
&& votesCount4 >votesCount12 && votesCount4 >votesCount13 &&
votesCount4 >votesCount14 && votesCount4 >votesCount15 && votesCount4
>votesCount16
&& votesCount4 >votesCount17 && votesCount4 >votesCount18 &&
votesCount4 >votesCount19 && votesCount4 >votesCount20)
printf("[%s]",CANDIDATE4);
else if(votesCount5>votesCount1 && votesCount5>votesCount2 && votesCount5
>votesCount3 && votesCount5 >votesCount4 && votesCount5 >votesCount6
&& votesCount5 >votesCount7 && votesCount5 >votesCount8 &&
votesCount5 >votesCount9 && votesCount5 >votesCount10 && votesCount5
>votesCount11
&& votesCount5 >votesCount12 && votesCount5 >votesCount13 &&
votesCount5 >votesCount14 && votesCount5 >votesCount15 && votesCount5
>votesCount16
&& votesCount5 >votesCount17 && votesCount5 >votesCount18 &&
votesCount5 >votesCount19 && votesCount5 >votesCount20)
printf("[%s]",CANDIDATE5);
else if(votesCount6>votesCount1 && votesCount6 >votesCount2 &&
votesCount6 >votesCount3 && votesCount6 >votesCount5 && votesCount6
>votesCount4
&& votesCount6 >votesCount7 && votesCount6 >votesCount8 &&
votesCount6 >votesCount9 && votesCount6 >votesCount10 && votesCount6
>votesCount11
&& votesCount6 >votesCount12 && votesCount6 >votesCount13 &&
votesCount6 >votesCount14 && votesCount6 >votesCount15 && votesCount6
>votesCount16
&& votesCount6 >votesCount17 && votesCount6 >votesCount18 &&
votesCount6 >votesCount19 && votesCount6 >votesCount20)
printf("[%s]",CANDIDATE6);
else if(votesCount7>votesCount1 && votesCount7>votesCount2 &&
votesCount7 >votesCount3 && votesCount7 >votesCount5 && votesCount7
>votesCount6
&& votesCount7 >votesCount4 && votesCount7 >votesCount8 &&
votesCount7>votesCount9 && votesCount7 >votesCount10 && votesCount7
>votesCount11
&& votesCount7 >votesCount12 && votesCount7 >votesCount13 &&
votesCount7 >votesCount14 && votesCount7 >votesCount15 && votesCount7
>votesCount16
&& votesCount7 >votesCount17 && votesCount7 >votesCount18 &&
votesCount7>votesCount19 && votesCount7 >votesCount20)
printf("[%s]",CANDIDATE7);
else if(votesCount8 >votesCount1 && votesCount8 >votesCount2 &&
votesCount8 >votesCount3 && votesCount8 >votesCount5 && votesCount8
>votesCount6
&& votesCount8 >votesCount7 && votesCount8 >votesCount4 &&
votesCount8 >votesCount9 && votesCount8 >votesCount10 && votesCount8
>votesCount11
&& votesCount8 >votesCount12 && votesCount8 >votesCount13 &&
votesCount8>votesCount14 && votesCount8 >votesCount15 && votesCount8
>votesCount16
&& votesCount8>votesCount17 && votesCount8 >votesCount18 &&
votesCount8 >votesCount19 && votesCount8 >votesCount20)
printf("[%s]",CANDIDATE8);
else if(votesCount9>votesCount1 && votesCount9>votesCount2 &&
votesCount9 >votesCount3 && votesCount9 >votesCount5 && votesCount9
>votesCount6
&& votesCount9 >votesCount7 && votesCount9 >votesCount8 &&
votesCount9 >votesCount4 && votesCount9 >votesCount10 && votesCount9
>votesCount11
&& votesCount9 >votesCount12 && votesCount9 >votesCount13 &&
votesCount9>votesCount14 && votesCount9>votesCount15 && votesCount9
>votesCount16
&& votesCount9 >votesCount17 && votesCount9>votesCount18 &&
votesCount9 >votesCount19 && votesCount9>votesCount20)
printf("[%s]",CANDIDATE9);
else if(votesCount10 >votesCount1 && votesCount10>votesCount2 &&
votesCount10 >votesCount3 && votesCount10 >votesCount5 && votesCount10
>votesCount6
&& votesCount10 >votesCount7 && votesCount10>votesCount8 &&
votesCount10>votesCount9 && votesCount10 >votesCount4 &&
votesCount10>votesCount11
&& votesCount10>votesCount12 && votesCount10 >votesCount13 &&
votesCount10 >votesCount14 && votesCount10 >votesCount15 && votesCount10
>votesCount16
&& votesCount10>votesCount17 && votesCount10 >votesCount18 &&
votesCount10 >votesCount19 && votesCount10 >votesCount20)
printf("[%s]",CANDIDATE10);
else if(votesCount11>votesCount1 && votesCount11>votesCount2 &&
votesCount11 >votesCount3 && votesCount11 >votesCount5 && votesCount11
>votesCount6
&& votesCount11>votesCount7 && votesCount11 >votesCount8 &&
votesCount11 >votesCount9 && votesCount11 >votesCount10 &&
votesCount11>votesCount4
&& votesCount11 >votesCount12 && votesCount11>votesCount13 &&
votesCount11 >votesCount14 && votesCount11 >votesCount15 && votesCount11
>votesCount16
&& votesCount11 >votesCount17 && votesCount11>votesCount18 &&
votesCount11 >votesCount19 && votesCount11 >votesCount20)
printf("[%s]",CANDIDATE11);
else if(votesCount12>votesCount1 && votesCount12>votesCount2 &&
votesCount12 >votesCount3 && votesCount12 >votesCount5 && votesCount12
>votesCount6
&& votesCount12 >votesCount7 && votesCount12 >votesCount8 &&
votesCount12 >votesCount9 && votesCount12 >votesCount10 &&
votesCount12>votesCount11
&& votesCount12>votesCount4 && votesCount12 >votesCount13 &&
votesCount12 >votesCount14 && votesCount12 >votesCount15 && votesCount12
>votesCount16
&& votesCount12 >votesCount17 && votesCount12 >votesCount18&&
votesCount12 >votesCount19 && votesCount12 >votesCount20)
printf("[%s]",CANDIDATE12);
else if(votesCount13>votesCount1 && votesCount13>votesCount2 &&
votesCount13 >votesCount3 && votesCount13 >votesCount13 && votesCount13
>votesCount6
&& votesCount13 >votesCount7 && votesCount13 >votesCount8 &&
votesCount13 >votesCount9 && votesCount13 >votesCount10 && votesCount13
>votesCount11
&& votesCount13 >votesCount12 && votesCount13 >votesCount4 &&
votesCount13 >votesCount14 && votesCount13 >votesCount15 && votesCount13
>votesCount16
&& votesCount13 >votesCount17 && votesCount13 >votesCount18&&
votesCount13>votesCount19 && votesCount13 >votesCount20)
printf("[%s]",CANDIDATE13);
else if(votesCount14>votesCount1 && votesCount14>votesCount2 &&
votesCount14>votesCount3 && votesCount14 >votesCount5 && votesCount14
>votesCount6
&& votesCount14 >votesCount7 && votesCount5 >votesCount8 &&
votesCount5 >votesCount9 && votesCount14 >votesCount10 && votesCount14
>votesCount11
&& votesCount14 >votesCount12 && votesCount14 >votesCount13 &&
votesCount14 >votesCount4 && votesCount14 >votesCount15 && votesCount14
>votesCount16
&& votesCount14>votesCount17 && votesCount14 >votesCount18 &&
votesCount14 >votesCount19 && votesCount14 >votesCount20)
printf("[%s]",CANDIDATE14);
else if(votesCount15>votesCount1 && votesCount15>votesCount2 &&
votesCount15 >votesCount3 && votesCount15 >votesCount5 && votesCount15
>votesCount6
&& votesCount15 >votesCount7 && votesCount15 >votesCount8 &&
votesCount15 >votesCount9 && votesCount15 >votesCount10 && votesCount15
>votesCount11
&& votesCount15 >votesCount12 && votesCount15 >votesCount13 &&
votesCount15 >votesCount14 && votesCount15 >votesCount4 && votesCount15
>votesCount16
&& votesCount15 >votesCount17 && votesCount15 >votesCount18 &&
votesCount15 >votesCount19 && votesCount15 >votesCount20)
printf("[%s]",CANDIDATE15);
else if(votesCount16>votesCount1 && votesCount16>votesCount2 &&
votesCount16 >votesCount3 && votesCount16 >votesCount5 && votesCount16
>votesCount6
&& votesCount16 >votesCount7 && votesCount16 >votesCount8 &&
votesCount16 >votesCount9 && votesCount16 >votesCount10 &&
votesCount16>votesCount11
&& votesCount16>votesCount12 && votesCount16 >votesCount13 &&
votesCount16 >votesCount14 && votesCount16 >votesCount15 &&
votesCount16>votesCount4
&& votesCount16>votesCount17 && votesCount16 >votesCount18 &&
votesCount16 >votesCount19 && votesCount16 >votesCount20)
printf("[%s]",CANDIDATE16);
else if(votesCount17>votesCount1 && votesCount17>votesCount2 &&
votesCount17 >votesCount3 && votesCount17 >votesCount5 && votesCount17
>votesCount6
&& votesCount17 >votesCount7 && votesCount17>votesCount8 &&
votesCount17>votesCount9 && votesCount17 >votesCount10 && votesCount17
>votesCount11
&& votesCount17 >votesCount12 && votesCount17 >votesCount13 &&
votesCount17 >votesCount14 && votesCount17>votesCount15 && votesCount17
>votesCount16
&& votesCount17 >votesCount4 && votesCount17 >votesCount18 &&
votesCount17 >votesCount19 && votesCount17 >votesCount20)
printf("[%s]",CANDIDATE17);
else if(votesCount18>votesCount1 && votesCount18>votesCount2 &&
votesCount18 >votesCount3 && votesCount18 >votesCount5 && votesCount18
>votesCount6
&& votesCount18 >votesCount7 && votesCount18>votesCount8 &&
votesCount18 >votesCount9 && votesCount18>votesCount10 &&
votesCount18>votesCount11
&& votesCount18 >votesCount12 && votesCount18>votesCount13 &&
votesCount18 >votesCount14 && votesCount18>votesCount15 &&
votesCount18>votesCount16
&& votesCount18 >votesCount17 && votesCount18 >votesCount4 &&
votesCount18 >votesCount19 && votesCount18>votesCount20)
printf("[%s]",CANDIDATE18);
else if(votesCount19>votesCount1 && votesCount19 >votesCount2 &&
votesCount19 >votesCount3 && votesCount19>votesCount5 && votesCount19
>votesCount6
&& votesCount19 >votesCount7 && votesCount19 >votesCount8 &&
votesCount19 >votesCount9 && votesCount19 >votesCount10 && votesCount19
>votesCount11
&& votesCount19>votesCount12 && votesCount19 >votesCount13 &&
votesCount19 >votesCount14 && votesCount19>votesCount15 && votesCount19
>votesCount16
&& votesCount19 >votesCount17 && votesCount19 >votesCount18 &&
votesCount19 >votesCount4 && votesCount19 >votesCount20)
printf("[%s]",CANDIDATE19);
else if(votesCount20>votesCount1 && votesCount20 >votesCount2 &&
votesCount20 >votesCount3 && votesCount20 >votesCount5 &&
votesCount20>votesCount6
&& votesCount20>votesCount7 && votesCount20 >votesCount8 &&
votesCount20>votesCount9 && votesCount20 >votesCount10 && votesCount20
>votesCount11
&& votesCount20 >votesCount12 && votesCount20 >votesCount13 &&
votesCount20 >votesCount14 && votesCount20>votesCount15 &&
votesCount20>votesCount16
&& votesCount20 >votesCount17 && votesCount20 >votesCount18 &&
votesCount20>votesCount19 && votesCount20 >votesCount4)
printf("[%s]",CANDIDATE20);
printf("----- Warning !!! No-win situation----");

int main()
{
int i;
int choice;

do{
printf("\n\n ==== Welcome to Election/Voting 2021 ====");
printf("\n\n 1. Cast the Vote");
printf("\n 2. Find Vote Count");
printf("\n 3. Find leading Candidate");
printf("\n 0. Exit");

printf("\n\n Please enter your choice : ");


scanf("%d", &choice);
switch(choice)
{
case 1: castVote();break;
case 2: votesCount();break;
case 3: getLeadingCandidate();break;
default: printf("\n Error: Invalid Choice");
}
}while(choice!=0);

//hold the screen


getchar();

return 0;
}
OUTPUT
CONCLUSION

Online Voting System project aims to increase the voting percentages across the
country; with the proposed system, people outside their hometown can also cast their
vote. It allows groups to securely conduct votes and elections.The online voting
system makes use of computer and internet which makes the overall voting procedure
easy. It saves time and avoids errors such as invalid votes and miscalculation of
votes.Overall, project is very economical and new features can be added as per
user requirements.

REFERENCES

In my report I take help from youtube in making the code. Following are the links of
youtube.
http://youtube.be/F4GWNWzB0Qg
http://youtube.be/WOHhH5BOQfM

You might also like