import java.io.*;
class election
{
public static void main(String args[])throws
IOException
{
DataInputStream in = new
DataInputStream(System.in);
int i,n,a=0,spoilt=0;
System.out.print("Enter number of ballots: ");
n = Integer.parseInt(in.readLine());
System.out.println();
int count[] = new int[n];
for(i=0;i
{
System.out.print("Enter Vote: ");
count[i] = Integer.parseInt(in.readLine());
if( count[i] == 1 || count[i] == 2 || count[i] == 3 || count[i] == 4 || count[i] ==5)
a++;
else
{
System.out.println("\t\tOutside the range");
spoilt++;
}
}
System.out.println("bollte paper: " + a);
System.out.println("spoilt parep: " + spoilt);
}
}
0 comments:
Post a Comment