You are on page 1of 5

Start

Name: Raghav Mundhra


Roll no.: 105

C1,C2,C3,C4,C5,SPOIL=0,BALLET

IS BALLET=1?

C1=C1+1;

IS
BALLET=2?

C2=C2+1;

IS BALLET=3?

C3=C3+1;

IS
BALLET=4?

C4=C4+1;
C5=C5+1;

IS
BALLET=5

SPOIL=SPOIL+1;

PRINT DO YOU
WANT TO
CONTINUE?

STOP

PROGRAM

#include<iostream.h>
#include<conio.h>
void main()
{

clrscr();

int ballet=0,c1=0,c2=0,c3=0,c4=0,c5=0,spoil=0,i;
char a;
do
{

cout<<"\n Enter the Ballet number: ";


cin>>ballet;

switch(ballet)
{

case 1:

case 2:

c1++;

break;
c2++;

break;

case 3:

case 4:

case 5:

default:

c3++;

break;
c4++;

break;
c5++;

break;
spoil++;
break;

cout<<"\n Do you want to continue? ";


cin>>a;

} while(a=='y'||a=='Y');

cout<<"\n The votes entered are: ";


cout<<"\n Candidate 1: "<<c1;
cout<<"\n Candidate 2: "<<c2;
cout<<"\n Candidate 3: "<<c3;

cout<<"\n Candidate 4: "<<c4;


cout<<"\n Candidate 5: "<<c5;

cout<<"\n Wrong votes: "<<spoil;


}

getch();

You might also like