Professional Documents
Culture Documents
ABDUL
ABDUL
ABDUL
Submitted to
The Department of Computer Science and Engineering
By
Principal
pg. 1
CONTENTS
1. Introduction 3-4
2. Source Code 5- 9
4. Conclusion 11
pg. 2
INTRODUCTION
Welcome to election voting system project in c. In this project we will
be developing a program that stimulates the process of election. This
program will allow users to cast their vote for a particular candidate
and then tally the vote the winner.
In this project we will be implementing an
election voting system in c programming language. We will use the
basic concepts of c programming, including dma, functions and
conditional statements, to design and develop a simple yet effective
voting system. The program will allow the user to select their
preferred candidate, and the voters I’d will be recorded in a file.
pg. 3
Here we are proposing a c program for voting process . The online
voting system will managesthe voter’s deatils,Candidate details. The
main feature ofthe project includesvoters information and candidate
information, voter can login and use his/hervoting rights. The system
canmanage the information data very efficiently.The proposed
system is more reliable, faster, accurate and easy to
handlecompared to existing manual system. It helps to computerize
everythingandreducing the errors as compare to manual voting
system.
pg. 4
SOURCE CODE :
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define CANDIDATE_COUNT
struct candidate{
char str[100];
int pc;
};
int choice;
strcpy(p[0].str,"KCR");
strcpy(p[1].str,"KTR");
pg. 5
strcpy(p[2].str,"kYR");
strcpy(p[3].str,"kMR");
p[0].pc=1001,p[1].pc=1002,p[2].pc=1003,p[3].pc=1004;
FILE *fp;
fp=fopen("project.c","a+");
scanf("%llu",&n);
fprintf(fp,"%llu\n",n);
fclose(fp);
scanf("%d",&choice);
switch(choice){
pg. 6
case 2: votesCount2++; break;
getchar();
pg. 7
void getLeadingCandidate(struct candidate *p){
printf("[%s]",p[0].str);
printf("[%s]",p[1].str);
printf("[%s]",p[2].str);
printf("[%s]",p[3].str);
else
int main()
pg. 8
struct candidate *p = malloc(4*sizeof(struct candidate));
int i;
int choice;
do{
printf("\n 0. Exit");
scanf("%d", &choice);
switch(choice)
case 1: castVote(p);break;
case 2: votesCount(p);break;
case 3: getLeadingCandidate(p);break;
}while(choice!=0);
getchar();
return 0;
pg. 9
pg. 10
CONCLUSION
This project emphasizes an user friendly interface for casting
the vote, as the objective of the project is to make reliable
system for recording and counting votes in an election.
Actually the design of the project the user has an access to
caste the vote and can see the statistics of the vote counts of
the candidate. The program calculates the number of votes
and displays the leading candidate to the user. As to avoid
some unfair means to vote the program takes the users
voterId before casting the vote. The program stores the users
Id in the file. In case of program malfunction it is easy to
rectify as the program is build module wisely. The potential
improvements that could be made to the system in the future
such as biometric authentication, data storage methods and
efficiency. overally the program gives a better a experience
with good efficiency.
pg. 11