/* Name: display prise , name and warrenty using regulasion operator Copyright: www.micted.weebly.com Author: Nawaraj Ghimire([email protected]) Date: 20/10/13 13:26 Description: To print name of furnature ,price and warrenty */ #include<stdio.h> #include<conio.h> #include<iostream.h> #include<iomanip.h> class furniture { private: int price; char name[20]; char warrenty[30]; public: void getprice(); void display(); }; void furniture::getprice() { cout<<"\n Manifacture furniture name:"; cin>>name; cout<<"\n Enter the price:"; cin>>price; cout<<"\n Enter the Warrenty :"; cin>>warrenty; } void furniture::display() { cout<<setw(5)<<endl; cout<<"Manifacture name="<<setw(2)<<name<<endl; cout<<"Price is:"<<setw(2)<<price<<endl; cout<<"Warrenty="<<setw(3)<<warrenty<<endl; } void main() { clrscr(); furniture f1, f2; f1.getprice(); f1.display(); f2.getprice(); f2.display(); getch(); }