voting vaala…:)

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
struct voter
{
int id, age;
char nm[20], add[50];
};

voter ward[20];
int main()
{
clrscr();
for(int i=0;i<2;i++)
{
cout<<”\n voter no.”<<i+1;
cout<<” \n enter id no.:”;
cin>>ward[i].id;
cout<<”\n Enter name:”;
gets(ward[i].nm);
cout<<”\n enter address:”;
gets(ward[i].add);
cout<<”\n Enter age”;
cin>> ward[i].age;
}
cout<<”\n voters with age more then 60 are:\n”;
for(i=0;i<20;i++)
{
if(ward[i].age>60)
{
cout<<”\n id no:”;
cout<<ward[i].id;
cout<<”\n name:”;
cout.write(ward[i].nm,20);
cout<<”\n”;
}
}
}

Advertisement

One Response to “voting vaala…:)”

  1. AMIT Says:

    in da for loop i<2 has been used corect it to i<20…
    given was done for a dry run….:)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.