C++ Store and Display the Details of Voters

C++ Store and Display the Details of Voters




 

#include<iostream.h>
#include<stdio.h>
#include<conio.h>
class voter
{
int id,age;
char name[30];
char add[20];

public:
void input();
void display();
};

void voter::input()
{
cout<<”Enter your Id: “;
cin>>id;
cout<<”\nEnter your Name :”;
gets(name);
cout<<”\nEnter your Address: “;
gets(add);
cout<<”\nEnter your Age: “;
cin>>age;
clrscr();
}
void voter::display()
{
if(age>=60)
{
cout<<”Name: “;
puts(name);
cout<<endl;
cout<<”Id: “<<id;
cout<<endl;
cout<<”Address: “;
puts(add);
cout<<endl;
cout<<”Age: “<<age;
cout<<endl;
clrscr();
}
}

void main()
{
voter A[4];
for(int i=0;i<=4;i++)
{
A.input();
A.display();
}
}

Click here for more C++ Programs

info@C++

C++ (pronounced “cee plus plus”).C++ is a general-purpose,powerful programming language.C++ is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. C++ was Developed by Bjarne Stroustrup starting in 1979.C++ adds OOPS-object oriented features such as classes, and other enhancements to the C programming language.


Rate this post




Further Reading:
http://en.wikipedia.org/wiki/Store
http://en.wikipedia.org/wiki/And
http://en.wikipedia.org/wiki/Display
http://en.wikipedia.org/wiki/Details

You read About:C++ Store and Display the Details of Voters

Posted by: Prateek on October 6, 2011


Previous Post: « Next Post: »

© 2017 Trendfy. All rights reserved
Blog Managed by Prateek Jaiswal