Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

EXP8_3 #include<iostream.h> #include<conio.

h> class product { public: long int price; char *id,name[20]; void accept() { cout<<"\nEnter Product name:\t"; cin>>name; cout<<"Enter the product price:\t"; cin>>price; } product(char *c="A0B0012") { id=c; } void display() { cout<<"\nProduct id:\t"<<id; cout<<"\nProduct name:\t"<<name; cout<<"\nProduct price:\t"<<price; } }; void main() { int i; clrscr(); product p[5]; for(i=0;i<5;i++) { p[i].accept(); } for(i=0;i<5;i++) { p[i].display(); } getch(); }

Page 1

Print to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

You might also like