Wednesday, 26 July 2017

program of class housing

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
class housing
{
private:
long int reg_no[20];
char name[30];
char type;
float cost;

public:
void read_data();
void display();
void draw_nos();
};
void housing::read_data()
{
cout<<"enter the rejistration no \n";
cin>>reg_no;
cout<<"enter the name \n";
gets(name);
cout<<"enter the type \n";
cin>>type;
cout<<"enter the cost \n";
cin>>cost;
}

void housing::display()
{
cout<<"the rejistration no \n";
cout<<reg_no<<"\n";
cout<<"the name \n";
puts(name);
cout<<"the type \n";
cout<<type<<"\n";
cout<<"the cost \n";
cout<<cost<<"\n";
}
void main()
{
clrscr();
housing h1;
h1.read_data();
h1.display();
getch();
}

No comments:

Post a Comment