Hi good friends. I am designing a program that accepts users choice from the listed candidates. The candidates are tallied and listed according to the votes casted against them. The program then returns the winner and the number of faulty votes. When I run the below code, I get 1 error of which I dont know where its coming from. Please help.
#include<iostream>
#include<conio>
using namespace std;
const int vs=4;
int votesA, votesB, votesC, spoiltvotes;//TOTALS ALREADY INITIALISED-GLOBAL
char vote;
void main()
{
// loop over the voting stations
for ( int i=1;i<=vs ;i++ )
// loop over voters
cout<<"\n Enter your vote:\t";
cin>>vote;
while( vote!='X')
{
switch(vote)
case A: votesA++;
break;
case B:votesB++;
break;
case 'C:votesC++;
break;
default:spoiltvotes++;
cout<<"\n Enter your vote:\t";
cin>>vote;
}
// display the results in a neat presentable format
cout<<"Number of votes for candidate\n\tA:"<<votesA;
cout<<"Number of votes for candidate B:";
cout<<votesB<<"\n\tNumber of votes for candidateC:"<<votesC;
cout<<"\n\nNumber of spoilt votes:\t"<<spoiltvotes;